Moving WordPress From A Subdirectory

Wordpress Dashboard > Settings > GeneralMany people install WordPress as a “test” in a subdirectory off of their root web directory.  Like  This allows them to keep their main site up while they develop and test the WordPress installation.

When it comes time to go live with their WordPress site, they frequently are advised to move the files to the web root and make many adjustments throughout the installation.  This is simply not needed.

You only need to handle 3 files at the most.

If you have installed WordPress in a subdirectory (like and want to move it to the web root ( you do not need to move the entire install. This is a common error made by many and results in a multitude of unneeded steps to get the site working again.

Please follow these steps (From the WordPress Codex):

Go to the General panel in your WordPress Dashboard.

1.  In the box for Site address (URL): change the address to the root directory’s URL. Example: Click Save Changes. (Do not worry about the error message if you get one and do not try to see your blog at this point! You will probably get a message about file not found.)

2.  Copy (NOT MOVE!) the index.php and .htaccess files from the WordPress (wordpress in our example) directory into the root directory of your site — the latter is probably named something like www or public_html. The .htaccess file is invisible, so you may have to set your FTP client to show hidden files. If you are not using pretty permalinks, then you may not have a .htaccess file. If you are running WordPress on a Windows (IIS) server and are using pretty permalinks, you’ll have a web.config rather than a .htaccess file in your WordPress directory.

3.  Move (DON’T COPY!) the wp-config.php file to your root directory.

4.  Edit your root directory’s index.php. Open your root directory’s index.php file in a text editor.  Change the line that says:


to the following, using your directory name for the WordPress core files:


Save the file.

5.  Login to your site (if you aren’t still already). The URL should still be  If you have set up Permalinks, go to the Permalinks panel and update your Permalink structure. WordPress will automatically update your .htaccess file if it has the appropriate file permissions. If WordPress can’t write to your .htaccess file, it will display the new rewrite rules to you, which you should manually copy into your .htaccess file (in the same directory as the main index.php file.)

Since the site is not working for some of these steps, it is best to make this change at a time of low activity, e.g., the middle of the night.

If you already have content in your site, see  when your domain name or URLs change for how to deal with references to the old URL that will remain in the database.

Looking for quality WordPress Web Hosting? Look no further than Arvixe Web Hosting!

Tags: , , , , , | Posted under cPanel/Linux Hosting, DotNet/Windows Hosting, WordPress, WordPress | RSS 2.0

One Comment on Moving WordPress From A Subdirectory

  1. WeKnowInfo says:

    Thanks Scott, this was very useful. I tried all steps provided in but still facing ‘Under Construction’ issue when i access my website. Step no 3, moving wp-config.php to root directory resolved my issue. Thanks again.

Leave a Reply

Your email address will not be published. Required fields are marked *