Support » Installing WordPress » Re-install self-hosted WordPress blog without losing content

  • I messed up my WordPress blog by messing with the Site URL.

    When I installed, I hadn’t realised it was set to install to

    the /wp directory was something I didn’t want. So in a rush, I messed with the Site URL inside WP settings and removed the /wp. Now not much works since it’s looking at a location where there’s nothing there.
    Could I simply just move all the files to fix it or do I need to reinstall? And how do I do so without losing all of my blog’s content?

    The blog I need help with is .

Viewing 4 replies - 1 through 4 (of 4 total)
  • If you just changed the Site Address (URL) in Settings > General then you can follow the section in the middle of the following page Giving WordPress Its Own Directory « WordPress Codex. Find the section under the heading Using a pre-existing subdirectory install

    It sounds like you have already done steps 1 – 3, so you would start with step 4 “Copy (NOT MOVE!) the index.php and .htaccess files from the WordPress…”

    Continue through Step 7 of in that section.

    This will allow you to keep your current setup within /wp but have your site resolve to your root domain.

    Okay, so I tried to follow the instructions on that link (thanks for that), however, I can’t seem to find the .htaccess. I checked it in several file managers with the hidden files option disabled yet it still was no where to be found.

    I copied the index.php file and whilst it showed the blog, there’s no CSS styling

    You may not have an .htaccess file if you have not adjusted your Permalink settings.

    An SEO friendly permalink setting is to use the permalink option of Post name.

    If you can log in go to Settings > Permalinks and update to the suggestion I mentioned.

    You also edited the copy of the index.php file with the addition as this correct?

    /** Loads the WordPress Environment and Template */

    Or this in newer versions of WP:

    /** Loads the WordPress Environment and Template */
    require( dirname( __FILE__ ) . '/wp/wp-blog-header.php' );

    Hey, very sorry about the late reply.

    Okay, I don’t believe I changed any Permalink settings.

    I’m unable to log in to the Admin panel as it redirects to the newly set I can access it by manually typing in the wp/ directory but as soon as I click Login, it reverts back, cancelling the log in.

    Yes, that’s correct. What I did was copy the index.php into the subdomain’s root directory, then opened it in Code Editor and altered the copy to say:

    /** Loads the WordPress Environment and Template */
    require( dirname( __FILE__ ) . '/wp/wp-blog-header.php' );

    Would I not be able to simply download the /wp-content folder, delete everything from the /wp directory, and reinstall it to the correct place and then move the original wp-content folder?
    I’m not too knowledgeable on WordPress’ filesystem so not sure where the content is stored.

    Many thanks for your help.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Re-install self-hosted WordPress blog without losing content’ is closed to new replies.