When creating a new test version of your site you do not want to interfere with your main site. The most common way to do this is to have the test site or program in a subfolder. Once you have completed your new site version, it is time to move it to the main domain area. Below is a guide on how to move your WordPress site from a subfolder to your main domain area.
Step 1: Make backup of your account
First things first. Whenever you begin to move files or make any radical changes, you want to make a backup copy of your account. This is great insurance in case something goes wrong. You can find the instructions on making a backup copy of your cPanel account here. Backup website files in cPanel.
Step 2: Preparing your Wordpress for the move
Before you begin to move the site files, you will want to prepare them for the new address. WordPress uses configuration files with URL paths in them so the process is not as simple as moving files and visiting the site. Check the steps below for how to configure the WordPress site to be ready to use the new URL after you move it.
- Log into your WordPress Dashboard.
- From the main dashboard, go to Administration -> Settings -> General.
- Next, look for the WordPress address (URI): and change it from (example.com/wordpress to example.com)
- Lastly, look for the Site Address address (URL): and change it from (example.com/wordpress to example.com)
Step 3: Moving your Wordpress from a subfolder to your main folder
Now that the backup copy of your account has been created and you have properly prpared the files, you can begin physically moving the files to your primary folder. The quick guide here shows you how to do that.
- Log into your cPanel admin dashboard.
- From the main cpanel area, look for the Files category and then click on the File Manager tool. Ensure you select the checlbox entitled Show Hidden Files.
- Once inside the File Manager, you will want to navigate to the folder you have the WordPress site in. For example, a folder named wordpress.
- You will see a list of all the wordpress files and folders in the right hand panel. Highlight them all and click on the Copy icon from the menu toolbar across the top of the page.
- A popup will appear so you can enter the destination folder. Continuing with our wordpress folder example, it should show as public_html/wordpress. Remove the /wordpress from the destination path so that it simply displays as public_html. Click the Copy Files button.
- This will copy the files up to the public_html folder. Use the File Manager to navigate back to the public_html folder. (You can do this by clicking on the Up One Level button from the toolbar across the top of the right hand panel.)
- You should now see the same files as you have in your wordpress folder.
- You can now delete the old wordpress folder.
Step 4: Log in and finish the URL details
After the move, you want to test the URL and ensure that the permalinks are all set to handle the new address to avoid any site errors.
- Log into your WordPress admin dashboard using the new URL. For example (example.com/wp-admin or example.com/wp-login.php)
- Go to Administration -> Settings -> Permalinks and ensure the link structure is the same as your new URL.