WordPress: How to Move Your Site to Another Folder
In this article, we will show you how to move your WordPress site from a subfolder or subdomain install, up to your main /public_html folder. This is useful if you have developed a new site in a sub folder and want to move it to your main domain now.
1): Login to SiteAdmin or cPanel (we are using SiteAdmin in this article)
2): Proceed to the File Manager by clicking the File Manager link found in the Website Tools section of the left menu.
3): Navigate to the location where your WordPress in installed. In this article, our WordPress is setup to work in the /blog subfolder.
4): Select all the contents of the subfolder (in this case, /blog). Copy (not move) all the contents of the sub folder into the main /public_html folder:
5): Once the files are copied, log into your wp-admin dashboard for the /*sub* site. Then go to Settings -> General, change the WordPress Address (URL) and Site Address (URL) to the main domain name. (this will likely also kick you out of the wp-admin page after saving, not to worry.)
6): Then go to the /wp-admin page for the new domain, make sure you can log in at the new location and everything is as it should be.
7:) If you are having issues logging back in, or getting a 404 or other error at the new domain/wp-admin page, check your .htaccess file in the /public_html folder. Remove any references to the old subfolder in the WordPress rewrite rules, such as:
RewriteBase /blog/ or RewriteRule . /blog/index.php [L}
They should read as follows instead:
RewriteBase / or RewriteRule . /index.php [L}
8): After you’re satisfied the site is correct, you can then remove the files for the old site in the subfolder, to save disk space, and keep things clean and organized in your file manager.
You may still have some images or files that are referring to the old URL. To fix these, you can use a plugin such as Velvet Blues to change any left over urls.
https://wordpress.org/plugins/velvet-blues-update-urls/
For more information on moving your WordPress site from different folders, or from one server to another, check out the official WordPress.org article on moving your site:
Mark Hemmingson January 29, 2015 at 10:54 pm
In my directory I have marksgardens.ca, plus three more sites in subdirectories. Everything is working fine with all four sites. All are WP sites.
I also have a subdomain in which I have a test-site that I’ve been using to try out plugins and themes. I have an Under Construction page set up on it. I also checked the box in my settings > readings that says… “Discourage search engines from indexing this site. It is up to search engines to honor this request.”
My question is, is this enough to keep the test-site hidden? Are there any other precautions I should take?
I would like to set up another test-site subdomain. Am I doing this properly?
Thanks. Mark.
James Davey January 30, 2015 at 6:18 am
Hi Mark,
Your setup should work fine, yes, and that should keep things safe from a casual check. If you really want to make sure, however, you may want to look into setting up a robots.txt file. We have a guide on this at http://kb.site5.com/bots/how-to-use-the-robots-txt-file/ and a supplementary guide at http://kb.site5.com/security/how-to-block-bots-that-dont-respect-your-robots-txt-file/
Matt February 17, 2016 at 4:35 am
I somehow can’t get this done not matter what I try. First of all, the settings panel doesn’t have the option to change wordpress and site address in my wp-admin. I figured this must be the same as changing the values for siteurl and home in phpMyAdmin, but somehow I always get an “Error establishing database connection”, even after changing the .htaccess file. Any idea what might be going on?
James Davey February 17, 2016 at 5:07 am
Hi Matt,
Those would be different, but would also not cause the error you mention. Have you contacted our support team on this? We’d be happy to take a look for you.