Move WordPress from Subfolder to Root – If you’ve set up your WordPress site in a subfolder and now want to move it to the root directory, you’re not alone. This common scenario can help streamline your website’s URL structure and improve user experience.

Move WordPress from Subfolder to Root – In this guide, we’ll walk you through the steps to seamlessly move your WordPress site from a subfolder to your homepage without losing data or functionality.
Why Move WordPress to the Root Directory?
Moving your WordPress site to the root directory offers several benefits:
- Simplified URL Structure: A cleaner URL (e.g.,
yourwebsite.cominstead ofyourwebsite.com/subfolder) improves SEO and user experience. - Ease of Access: Users can find your site more easily when it’s accessible from the primary domain.
- Improved Site Management: Managing your site in the root directory can be simpler, especially for updates and backups.
Step-by-Step Guide to Move WordPress from Subfolder to Root
Step 1: Backup Your Site
Before making any changes, it’s crucial to back up your entire WordPress site. This includes your database and all files. You can use a plugin like UpdraftPlus or BackWPup, or perform a manual backup via cPanel or FTP.
Step 2: Move Files from Subfolder to Root Directory
- Access Your Server: Use an FTP client (like FileZilla) or your web hosting control panel (like cPanel) to access your website files.
- Navigate to Subfolder: Go to the directory where your WordPress files are currently located (e.g.,
public_html/subfolder). - Select All Files: Highlight all files and folders within the subfolder, excluding the subfolder itself.
- Move Files: Drag and drop the selected files to the root directory (e.g.,
public_html).
Step 3: Update the Site URL in WordPress
- Log into WordPress Admin: Go to your WordPress admin dashboard (if accessible).
- Go to Settings: Navigate to Settings > General.
- Update URLs: Change both the WordPress Address (URL) and Site Address (URL) to reflect your new root directory (e.g.,
https://yourwebsite.com). - Save Changes: Click Save Changes at the bottom of the page.
Step 4: Update the .htaccess File
If you have a custom .htaccess file, you may need to update it to ensure proper redirection.
- Access the Root Directory: Using your FTP client or file manager, locate the
.htaccessfile in the root directory. - Edit the File: Open it and make sure the WordPress rewrite rules are correct. The standard rules look like this:
- Save and Close: After making any necessary adjustments, save the file.
Step 5: Test Your Site
- Clear Cache: Clear your browser cache and any caching plugins on your site.
- Visit Your Site: Enter your domain name in the browser and check if everything loads correctly from the root directory.
- Check Links: Test various links and functionality to ensure everything is working smoothly.
Step 6: Set Up 301 Redirects (If Necessary)
If users may still access the old URL (subfolder), set up 301 redirects to direct them to the new location.
- Edit the
.htaccessFile: In the root directory, add a line to redirect the old subfolder URL to the new root URL: - Save Changes: Ensure you save the
.htaccessfile after adding the redirect.
Conclusion
Move WordPress from Subfolder to Root directory can significantly enhance accessibility and improve your site’s overall SEO. By following these steps, you can make the transition smoothly and with minimal disruption. Always remember to back up your site before making any changes and test thoroughly after the move. With your WordPress site now in the root directory, you’re ready to enjoy a cleaner, more user-friendly web presence!
