Moving WordPress from Subdomain to Root? Here Are 2 Methods Helping Website Owners

Bulletproof Backups for Your WordPress Website

Fortify your business continuity with foolproof WordPress backups. No data loss, no downtime — just secure, seamless operation.

Moving WordPress from subdomain to root

Is your WordPress site on a subdomain? Whether for staging or organization, it’s impacting your SEO, as Google treats it as a separate website, splitting your domain authority.

Moving WordPress from subdomain to root cannot wait any longer. While WordPress migrations can seem daunting, they don’t have to be. We will make sure of that.

This guide streamlines the process using two simple methods, all without compromising your site or affecting your rankings. Best of all, you don’t have to be a developer to do this.

TL;DR: Moving your WordPress site from a subdomain to your root helps Google find and rank your content better. You can do this using a plugin or manually. Always backup first using a backup plugin. If something breaks, you can easily restore everything.

Non-negotiable pre-move checklist

Before you touch a single file, complete these steps. Missing any of these steps turns a smooth WordPress migration into a nightmare recovery project.

Full backups. Create complete backups of your files and database. Use a plugin like BlogVault to handle this.

Schedule during low-traffic hours. Plan your WordPress migration during your slowest traffic period. Check Google Analytics to find when you have the fewest visitors. This minimizes the impact if something goes wrong.

Enable maintenance mode. Put up a maintenance page so visitors see a professional message instead of broken content. This is critical for WooCommerce sites. Customers shouldn’t face errors during the migration.

Disable caching. Turn off all caching plugins. These can serve old cached versions of your site, making it impossible to tell if your migration worked properly.

Document current WordPress URLs. Write down your current WordPress Address and Site Address from Settings > General. You’ll need these URLs once you complete your migration.

Pre move checklist

A) Use a plugin to help with moving WordPress from subdomain to root

If you’re thinking, “I just want this done quickly without breaking anything,” a plugin like Migrate Guru is your best bet. You won’t need to touch code or databases.

We recommend Migrate Guru because it handles the technical headaches for you. Automatic redirects preserve your SEO, and all URLs get updated automatically. The migration runs on BlogVault’s powerful servers (not your hosting) and can handle sites up to 100GB.

Install the plugin on your subdomain site AND your root domain. Navigate to Plugins and Add New. Look for Migrate Guru, once you find it, click Install and Activate on both sites.

migrate guru plugin

Copy the migration key from the destination. On your root domain site, click on Migrate Guru from the side panel. Next, click on the Migration Key drop-down and copy the unique key.

Migration Key Copy

Initiate migration from the source site. Now, from your subdomain’s side panel, click on Migrate Guru, enter your email, and click on Migrate. Pick your current hosting provider from the list. If you can’t find yours, select Other Hosts.

Host selection Migrate Guru

Paste your migration key and click Migrate.

Paste migration key

Migration typically takes a few minutes, depending on your site size. The plugin will email you when it’s done. Your subdomain content should now be live on your root domain with all redirects and SEO intact.

Migration process bar

B) Manually moving WordPress from subdomain to root

If you want full control over your migration or prefer understanding exactly what’s happening, go for the manual method. Keep in mind that this takes more time. We will be using cPanel’s File Manager for this method.

Move your files via cPanel. Log in to your hosting account and open cPanel. Click on File Manager. Navigate to your subdomain’s folder under your root directory. The path is usually something like /public_html/subdomainname.

Subdomain path

Note: You can do this using FTP as well. You can find the access credentials from your hosting provider.

Open your subdomain folder. You’ll see all your WordPress files here. Select ALL files in this folder. Once you do, move them to your root folder (/public_html), overwriting the existing files.

Move subdomain files to root

Keep in mind that this process will take time, especially if you have a large site. Don’t panic if it seems slow.

Update your WordPress configuration. Now that your files have been moved, you need to make a few adjustments. In your root folder, find and open wp-config.php (right-click > Edit). Look for the line that says, That’s all, stop editing!.

edit wp config file

Add these lines ABOVE that comment:

define('WP_HOME', 'https://yourdomain.com');

define('WP_SITEURL', 'https://yourdomain.com');

Replace yourdomain.com with your actual domain. This tells WordPress your new address.

Update your database URLs. Install the Better Search Replace plugin from your WordPress admin. Go to Tools > Better Search Replace.

Fill in the search and replace fields:

Search for: https://subdomain.yourdomain.com

Replace with: https://yourdomain.com

Select ALL tables and click Run Search Replace.

This updates every reference to your old subdomain URL in your database. Without this step, your images and internal links will still point to the old location.

Post-move checklist

Your migration is complete, but you still need to verify everything works before your visitors notice any issues.

Test basic functionality

Visit yourdomain.com in your browser to ensure your site is loading correctly. Also, attempt to log in to your WordPress admin at yourdomain.com/wp-admin using your usual username and password to see if everything is working right.

Check your content

Open three different blog posts from your site. Check that all images are loading correctly. Test any contact forms on your site by submitting a test message.

Set up redirects

This step is critical for preserving your SEO. In your root folder, find the .htaccess file (create one if it doesn’t exist). Open it and paste this at the very top:

RewriteEngine On  

RewriteCond %{HTTP_HOST} ^old\.yourdomain\.com$ [NC]  

RewriteRule (.*) https://yourdomain.com/$1 [R=301,L]

Replace old.yourdomain.com with your old subdomain. This automatically sends visitors from old.yourdomain.com/post to yourdomain.com/post.

Test the redirect by visiting your old subdomain URL.

Final cleanup

Re-enable any caching plugins you disabled earlier. Disable maintenance mode. Delete the old subdomain files to free up hosting space. Update your Google Search Console property to point to your new root domain.

Your WordPress site is now successfully running from your root domain with all SEO juice preserved.

Post mive checklist

Troubleshooting common issues

Something went wrong during your migration? Don’t panic. These are the most common problems and their quick fixes.

White screen of death

Your site shows a blank white page instead of your content. This usually means PHP errors, plugin conflicts, or memory limits.

Enable WordPress debugging by adding this to your wp-config.php file:

define('WP_DEBUG', true);

Broken links or 404 errors

Your internal links lead to “page not found” errors. This happens when URLs weren’t properly updated during the move.

Set up redirects in your .htaccess file or run the Better Search Replace plugin again to catch missed URLs.

Database connection errors

You see Error establishing a database connection instead of your site. Your database settings are incorrect.

Double-check your wp-config.php file. Make sure DB_NAME, DB_USER, and DB_PASSWORD match your hosting account settings.

Missing styles or broken layout

Your site loads but looks broken—no colors, fonts, or proper layout. File paths or permissions are wrong.

Check that your theme and plugin files were transferred correctly. Set folder permissions to 755 and file permissions to 644 via your hosting file manager or FTP.

Login issues or stuck in maintenance mode

You can’t log into your WordPress admin, or you’re stuck seeing a maintenance page. Cache or cookie problems are blocking access.

Clear your browser cache and cookies. If you’re still stuck, delete the .maintenance file from your root directory via FTP.

Parting thoughts

Migrating from a subdomain to the root is a major win for SEO and user experience. You’ve consolidated your domain authority and simplified site management.

Don’t skip the post-move tasks. Proper redirects and ongoing site maintenance are what separate a successful migration from potential issues down the road.

FAQs

How do I move a WordPress site to the root folder?

To move WordPress to the root folder, copy the site files from the subdomain/subdirectory folder to the root directory. Update the site URL in the WordPress settings and adjust permalinks. Finally, don’t forget to set up proper redirects.

How to redirect a subdomain to the main domain in WordPress?

You can use a 301 redirect in your .htaccess file to redirect a subdomain to the main domain. This tells browsers and search engines that the content has permanently moved. It’s essential for maintaining SEO value.

How do I move WordPress to a different domain?

To move WordPress to a different domain, back up your site and database, and move files to the new domain’s directory. Update the database with the new domain URL and ensure all internal links are correct.

Does a subdomain affect the main domain?

Yes, a subdomain can affect the main domain as it splits your SEO authority. Google treats subdomains as separate websites, which can dilute your SEO efforts. Consolidating to the main domain is often more effective.

Is Migrate Guru free?

Yes, Migrate Guru is free for unlimited site migrations. It simplifies the process without requiring any technical expertise, making it an excellent choice for most users.

Tags:

You may also like


How do you update and backup your website?

Creating Backup and Updating website can be time consuming and error-prone. BlogVault will save you hours everyday while providing you complete peace of mind.

Updating Everything Manually?

But it’s too time consuming, complicated and stops you from achieving your full potential. You don’t want to put your business at risk with inefficient management.

Backup Your WordPress Site

Install the plugin on your website, let it sync and you’re done. Get automated, scheduled backups for your critical site data, and make sure your website never experiences downtime again.