How to Move WordPress Site From Subdomain to Root Domain? Best of 2023

Do you wish to Move WordPress site from subdomain to root domain? So users don’t worry. The process is very simple to follow, and there is a right way to save your SEO rankings. Get the best WordPress search engine optimization services to rank your site at the top through WP Global Support.

Where WordPress is an open-source platform that you would have to download and host it on a webserver. It is a completely customizable CMS and powered many most popular website over the globe. The CMS is Content Management System allows users to easily create, edit, organize and publishing content. 

WordPress is one of the most widely used and easy to use content management system which gives many facilities to users. It facilitates the user in creating, editing, organizing and publishing the content on the web servers.

As subdomain is also know as the sub directory, this can happen by either installing WordPress in a subdomain. Search engines treat subdomains variously from root domain name and let them rankings as a fully different website.

As search engine is a service which allows all internet user to search for any content, query, and product throughout the world wide web. When the users search something on the search engine the words used by him/her to search are known as keywords or key phrases.

Search engine clearly states that the user’s search keywords are the efforts to get information about a topic. The result shown by the search engine for any keyword is known as the search engine results page (SERP). SERP gives competitive advantages to WordPress website.

So read the whole article carefully as we have shown the complete steps to move WordPress site from Subdomain to Root Domain.

Move WordPress Site from Subdomain to Root Domain

A subdomain is an extension of the root domain name. For example, is a subdomain of In the above case, is the root domain.

Search engines see subdomain to be the different website. This is why you need to make sure that you perfectly redirect search engines to the root domain after the transfer.

Let’s take a look at:

How to migrate a WordPress site from subdomain to root domain.

Step 1. Create a Full Backup of Your Website

You should always conduct a backup solution installed on your website for automated backups. WordPress backup allows you to save your WordPress site data in case of any hacking & crashing attempts. It restores your data normally in the event of any problem.

That’s why WordPress backup and restore process is necessary as it safeguards you from the possibility of losing everything. There are many WordPress backup plugins that you can use to keep your WordPress content safe.

if you already have a backup plugin installed, then you might imagine that you can skip this step. Also, this step is to remember you that even if you have automated backup WordPress website, and you still need to create a complete backup WordPress site. This involves a database backup and backup of all your WordPress files and folders.

After you have created a complete backup, make sure that you store it in a remote location or on your computer.

Read Also: 4 simple way to backup your WordPress site

Step 2. Migrating Your WordPress Files From Subdomain to Root Folder

  • Firstly connect to your website using an FTP client or via cPanel’s file manager. After you got connected, just go to your subfolder location and download your whole WordPress files to your computer.
WordPress Site

  • After that open the public_html folder of your root domain. Relying on how your WordPress hosting environment is set up, this folder can be named www or after your domain name.
  • Upload whole WordPress files you downloaded earlier to the root directory.

Step 3. Change Settings of WordPress URL and Site URL

After migrating the WordPress files, you will not be capable to access the WordPress admin area on the root domain. When you try to login the root website will send you back to the subdomain website’s admin area.

The FTP client is a software that helps users to transfer your files from your web server, the File Transfer Protocol is an internet protocol. Further on it is an easy, fast, and secure way of transmitting the information between a server and client.

For fixing this:

  • Switch to the FTP client and go to the root directory of your domain name.
  • Edit the wp-config.php file and add the below-given lines just before the line
Move WordPress Site
WordPress Site



  • Don’t miss to replace with your own domain name. If you want your root website to take www then enter the URLs with www prefix.
  • Lastly, save your all changes and upload the wp-config.php file back to your website. You can now easily visit your WordPress site’s admin area on the root domain name.

Step 4. Update URLs

However, your WordPress site has transferred to the root domain, but there will be links inside your WordPress database indicating to the subdomain. Where database is a collection of any information which is categorized in a manner. It can be easily managed, accessed and updated.

WordPress database schema is a structured, organized set of data that follows mainly workloads so that creation and updating can be done on it easily.

For fixing this.

  • Firstly install and activate the Velvet Blues Update URLs plugin. For more information, check our stepwise guide on how to install a Plugin in WordPress.
  • After the activation, visit Tools » Update URLs page. 
WordPress Site

  • On this page, just enter your subdomain URL which is next to the Old URL option and add your root domain to the new URL. Inside the ‘Choose which URLs should be updated’ area, check all options except ‘All GUIDs’.
  • Also, click on the ‘Update URLs Now’ button to continue once you are done. The plugin will now update all URLs in your WordPress database. After the completion, you will see a success message.

Step 5. Redirect All Subdomain Traffic to The Root Domain Name

Check that all subdomain traffic is redirected to the root domain name.

  • First of all, go to your subdomain folder and check that hidden files are enforced to be visible.
  • However, your FTP client settings have an option to always show hidden files and in FileZilla, it is presented under ‘Server > Force Showing Hidden Files’ option.
Move WordPress from Subdomain to Root
WordPress Site

  • In case you are using cPanel File Manager, click on the Settings button at the top right corner of the screen. This will show up the preferences popup.
  • Select ‘Show hidden files’ and then click on the save button. In case your subdomain folder previously has a .htaccess file, you can delete it and create a new one. Inside the new .htaccess file, copy and paste the below-given code:
1 <IfModule mod_rewrite.c>


2 RewriteEngine On

3 RewriteBase /

4 RewriteCond %{HTTP_HOST} ^yoursubdomain\.example\.com$ [NC]

5 RewriteRule ^(.*)$ “$1” [R=301,L]

6 </IfModule>

  • The RewriteRule line uses a non-www URL. If you want to take www in your root domain, then add your URL with a www prefix. Just replace your subdomain with your actual subdomain and with your domain name.
  • Save your all changes and upload your .htaccess file to the server.

Now you have successfully transferred your site from the subdomain to root domain. You can also visit your website to see it in action. Check out your website to make sure that everything is working good.


So, by following the above five steps you can easily migrate your WordPress from subdomain to Root Domain. We hope that the above article helped you to move WordPress from subdomain to Root Domain successfully.

You can also talk to our WordPress Technical Support Team in case of any difficulty related to WordPress, Dial +1-888-738-0846 (Toll-Free). We will solve all your issues related to WordPress so feel free to contact.

Leave a Reply