Domain and subdomain, both are pretty similar in terms of use. Although the main domain has the upper priority, you need a subdomain for various purposes. Because of the upper priority, you may need to transfer your WordPress site from the subdomain to the main domain. And it is the right thing to do.
By any chance, your WordPress site is hosted on a subdomain, and you are wondering, “How to transfer WordPress site from subdomain to main domain?” Then you should start reading this article as we are going to show you this process within 5 simple steps.
Transferring WordPress Site from Subdomain to Main Domain with 5 Simple Steps
A subdomain is an augmentation of the root domain. That is why the domain always has privilege over its subdomains. To give you an example, website.abc.com can be a subdomain of abc.com, where abc.com is the main or root domain.
Search engines will treat your website differently if it is hosted on a subdomain. Thus, it will create a negative impact on the SEO score of your website. Therefore, you need to divert web crawlers to the root domain rather than the subdomain. This will assist in preserving your search rank even after you move your website.
Transferring your WordPress site from subdomain to main domain is much easier. Luckily, the process is not as complex as moving a WordPress website to a new domain or new host. If you ask –
“Why is it easy to move WordPress site from subdomain to main domain?”
The answer is pretty simple, it is because both the root and subdomain are hosted with the same web hosting company. Therefore, you don’t need to go through tons of steps.
So, without further ado, how about we investigate how to move a WordPress site from subdomain to main domain? Let’s begin with the number one step.
Step 1: Make Sure You Have a Backup of Your Website
Before you go through this process, you must have a backup of your WordPress site. To create a backup of your WordPress site, you must have an automated backup solution installed on your website. You don’t have to worry about finding a backup tool, there are tons of WordPress backup plugins available for free.
On the other hand, you may already have a backup plugin installed on your WordPress site. Whether or not you have a backup plugin, you must create a complete backup of your website before moving your WordPress site from the subdomain to the main domain.
You may think – “I have automated backup, I can skip this”. Well, that might be true. But you need to ensure the most recent backup of your site that includes a complete database with all the necessary WordPress files and folders. After creating a complete backup, don’t forget to store it on a secure cloud or on your local storage.
Step 2: Move Necessary WordPress Files from Subdomain to Root Folder
Before moving your website to the root domain, you have to transfer the necessary files to the root folder. You should have access to your FTP or cPanel. If not, contact your hosting provider immediately. They will give you access to your FTP server or cPanel.

When you connect to either the FTP server or cPanel, head towards the subfolder location and download all the necessary WordPress files to your computer. After that, locate the public_html folder and open it, which can be found inside the root domain.
Please Note: The public_html folder can be named as ‘www’ or after your domain name. It depends on the hosting environment. |
In this folder, upload all the files that you have downloaded earlier from the root directory.

Step 3: Change the URL of Your WordPress Site and Configure URL Settings
After successfully moving the WordPress files, you will gain access to the WordPress admin panel of the root domain. However, when you try to log in to the admin area of the root website, it will render you back to the admin area of the subdomain.
If this bothers you, then you need to fix it. Follow these quick steps below to change the URL of the WordPress site and configure your URL settings -First, switch to the FTP client and head towards the root directory of your domain.
1. First, switch to the FTP client and head towards the root directory of your domain.
2. Here, you need to edit the wp-config.php file. Open the file and add the following code right before the line, where it says – “That’s all, stop editing! Happy blogging”.
define(‘WP_HOME’,’http://example.com’); define(‘WP_SITEURL’,’http://example.com’); |
Please Note: You need to replace example.com with your domain name. If you prefer using ‘www’ for the root website, you should add the ‘www’ prefix to the URL. |
3. Now, you have to upload the wp-config.php file on the website after you have saved the changes.
After applying the above steps, you will be able to visit the admin area of your WordPress site from the root domain name.
Step 4: Update Related URLs
Even if you have moved your WordPress site to the root domain, there will be links pointing to the subdomain of your WordPress site. Now, where can you find these links? These links can be found inside the WordPress database.
To fix this issue, we will show you the easiest method rather than other critical steps that involve coding.
There is a plugin called Velvet Blues Update URLs. You need to install and activate it. Once you have done that, go to (Tools » Update URLs) inside the plugin folder.

On this page, you would like to enter your subdomain Universal Resource Locator (URL) next to the old URL. Then, set your root domain as the new URL. Next, beneath the “Choose which URLs should be updated” area, you need to check all choices except “All GUIDs”.
If you have done that, click the “Update URLs Now” button to continue. After clicking the button, all the URLs inside the WordPress database will be updated. This may take a while, so sit back and relax as you will get a success message once it is done.
Handpicked article for you – How to integrate Zoom into your WordPress site? (+Top 5 plugins) |
Stage 5. Divert All Subdomain Traffic to The Main Domain
We are almost there. To transfer your WordPress website from the subdomain to the root domain, you have to make sure all the traffic of the subdomain is redirected to the root domain. To make it happen, go to the subdomain folder and make the hidden files visible (if there are any).
If you are visiting as an FTP client, there should always be an option to make the hidden files visible. For instance, you can make the hidden files visible inside the cPanel File Manager by navigating towards Settings, which can be found at the top right corner of the screen.
Read this – If you want an internship (remote) in WordPress |
This will bring a popup window (named ‘Preferences’). Inside the popup window, you just need to select “Show Hidden Files” and hit the Save button.

And if you are using FileZilla, the option to show the hidden files will be under Server. Then, you need to check the “Force Showing Hidden Files” option. That’s it.

You can delete the .htaccess file if the subdomain folder already has one. Then, create a new .htaccess file. To make it functional, copy and paste the following code inside it –
<IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} ^yoursubdomain\.example\.com$ [NC] RewriteRule ^(.*)$ “http://example.com/$1” [R=301,L] </IfModule> |
Please Note: Here, yoursubdomain will be replaced with your actual domain and example.com will be replaced with your domain name. Also, add the ‘www’ prefix to your URL if you prefer to use ‘www’ in your root domain |
Once everything is done, save the changes inside the .htaccess file and upload it to the server. Great! Now you know how to transfer WordPress site from subdomain to main domain
Bottom Line
Well, we hope you got your answer to – how to transfer WordPress site from subdomain to main domain. Before you begin the transfer, please make sure you have sufficient backup of your database and other necessary files. Also, the other procedures that we have mentioned earlier in this article. And two important things for moving your website from subdomain to main domain are –
- Removing files from the public_html directory from your previous websites (if any).
- No other folders except the files of your designated website are available in the root directory.
We hope the process was plain and simple. But if you got stuck with any of these steps, please let us know by leaving a comment below. We will be glad to give you a piece of quick advice.