When launching our website, we faced the task of moving it from a testing subfolder to the main directory. This common challenge for developers often arises during site development to keep unfinished work hidden.
Below are the steps we followed to move WordPress from a subfolder to the root directory:
- Backup Your Site:
Before making changes, create a backup of your website files using cPanel. - Prepare Your WordPress Installation:
- Move WordPress Files
- Log into your cPanel admin dashboard and open File manager. Ensure now Hidden files is checked.
- Navigate to the subfolder (e.g., public_html/wordpress).
- Select all WordPress files, click the Copy icon, and set the destination to public_html (remove the /wordpress part).
- Click Copy Files to transfer them.
- Log into your cPanel admin dashboard and open File manager. Ensure now Hidden files is checked.
- Delete the Old Subfolder
- Once the files are copied, navigate back to the public_html folder and confirm the files are present.
- Delete the old subfolder (e.g., wordpress).
- Finalize URL Details
- Log into your new WordPress admin dashboard (e.g., example.com/wp-admin).
- Go to Settings > Permalinks and ensure the link structure is updated to reflect the new URL.
Following these steps allows for a smooth transition of your WordPress site from a subfolder to the root directory.
After migrating your WordPress site, plugins might disappear. Check out our guide on how to fix plugins disappearing from the WordPress dashboard.