Site5 - Built For Designers & Developers MENU
Home  ›  Scripts/Software  ›  WordPress  ›  WordPress: How to Move Your Site to Another Folder

WordPress: How to Move Your Site to Another Folder

4 Comments

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:

copywpfiles

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.)

changewpdomain
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:

https://codex.wordpress.org/Moving_WordPress

Still have a question? Or need help?
See an error in this article or want to suggest a missing topic? Please leave us a comment below! If you need technical support with your account, please email us, chat live with a representative, or call us!

4 Comments

  • 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.

  • 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?

    • 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.

Money Back Guarantees
Click to verify BBB accreditation and to see a BBB report.