Many develop and test new website versions in subfolders to avoid interfering with their primary domain. Once they are done, they’ll be looking to transfer the site into the leading directory of the field. This is commonplace with WordPress. Follow the steps below as we guide how you can move WordPress out of a subfolder onto the Root Directory.
Make a backup of your account.
Before you begin the process, Creating an account backup before making any modifications is an excellent idea. Learn how to create backups by clicking here. Make backups of your website’s files within the cPanel.
Make sure you have your WordPress installation to be ready for the change.
Before physically moving the files, you must configure the installation for the new URL.
- Log in to Your WordPress Dashboard, for instance.
- On the dashboard that you are on, click 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)
Then, move the contents of your WordPress to a new folder in the main folder.
Once you’ve created backups, deleted the website content from the builder, and made the WordPress files, it’s time to transfer your WordPress into the main folder.
- Log into your cPanel admin dashboard.
- Search within the files category in the cPanel’s central area, then select the File Manager tool. Navigate to Settings. In the preferences window, click the checkbox titled to show hidden files.
- When you’re in the File Manager, You must go to the folder where your WordPress site is placed. For instance, a folder called WordPress.
- A list of all WordPress folders and files is on the right-hand panel. Mark them all and click the Copy icon in the menu toolbar at the upper right of the page.
- A pop-up window will open to go to the folder you want. Continuing our WordPress folder example, it should show as public_html/WordPress. Eliminate the “/WordPress” in the path to the destination so that it shows in publicly-html. Select the copy files button.
- The files will be copied onto the publicly-accessible folder. Make use of File Manager to return to public_html. The public_html folder. (You can accomplish this by clicking the Up One Level button in the toolbar at the top of the right-hand panel.)
- Now, you should see identical files to those you do within the WordPress file.
- You are now able to erase your previous WordPress directory.
Log in, and then complete the URL information.
- Log in to Your NEW WordPress administrator dashboard. For example (example.com/wp-admin or example.com/wp-login.php)
- Click on Administration> Settings Permalinks and ensure your link structure is identical to the new URL.
Are you keen to unlock the potential of WordPress? The managed WordPress platform we offer WordPress has been tuned to provide high performance as well as security. We also offer the best hosting available. Check out the WordPress hosting packages.
- Edit your wp-config.php file.
- In the upper right corner of the file, you should add define(‘RELOCATE,’ true); line: Copy.
- Go to your https://www.example.com/wp/wp-login.php webpage in your browser.
- Be sure to enter the path to your WordPress primary files before wp-login.php
- Log in to your WordPress dashboard the same way you usually do.
- If you go to Settings > General and then General, you will notice that WordPress has already filled in the WordPress address (URL) field for you, including the URL to your WordPress files.