When building a website on a subdomain (for development purposes most likely) you will eventually need to move the WordPress install to the main root folder (to launch it on the main domain). In this example we will be moving our development website located on our subdomain http://dev.yourdomain.com to our main domain http://yourdomain.com. This is a simple process but must be done in the correct order to avoid breaking your website.
If we looked through FTP at our website files currently we would see this:
1. Change your WordPress site address
Inside your WordPress admin go to Settings > General. Here you will find your site address:
Change both lines from the subdomain to your main domain. Make sure to triple check your spelling. Save the updates. At this point your site will try to redirect to the login screen but will result in an error, don’t worry (this is the correct behavior).
2. Move your WordPress files
Next go back into your FTP to access your website files. Move all of the website files from the subdomain folder to the main/root folder.
3. Search Replace
At this point you will be able to log into your website on the main domain. There is one step left. Install the following plugin:
After the plugin is installed access it under the “Tools” menu inside the WordPress admin. Search for the old subdomain and replace with the new domain. This will change any links and text in your content.
That’s it, now you can tell all your friends about your awesome new website!