All Collections
Website
Other
Moving a WordPress Website From a Subdomain to the Root Domain
Moving a WordPress Website From a Subdomain to the Root Domain

Learn how to manually migrate your WordPress website from a subdomain to the root domain

Updated over a week ago

If you wish to move your website from a subdomain to the root domain (subdomain.domain.tlddomain.tld), follow the steps below 👇

First, make sure the root domain is added to your hosting plan – it should be visible in the Websites section of hPanel 💡

Step 1 – Copy Files From the Subdomain to the Root Domain

1. In the Websites section, click on Manage next to your website that's connected to the subdomain.

2. In the left sidebar, search for File Manager and access all the files within your hosting plan:

3. Open the domains folder, then open the folder of your website (e.g., subdomain.domain.tld), and then open the public_html folder within:

Accessing files within a hosting plan at Hostinger

3. Select all the files, and copy them to the root domain (make sure its folder is empty):

Copying files within a hosting plan at Hostinger

To choose the correct destination folder (e.g., domain.tld), click on the .. icon to go to the parent folder as many times as you need. Learn more: Basic Actions in the File Manager 💡

Step 2 – Connect the Database

There are two options to choose from:

Option 1

If you wish for the subdomain to remain active, duplicate the database and connect the new database to your website:

  1. Download a backup of your original website's database

  2. Create a new database for your new website (that's on the root domain)

  3. Import the database backup to the new website

  4. Update the database details (name, username, password) in the wp-config.php file

Option 2

If you don't want to keep the subdomain active, you can leave the previous database connected.

Step 3 – Fix URLs

Finally, update your website's URLs by replacing the subdomain with the root domain. There are a couple of ways to do that:

And that's how you move your website from a subdomain to the root domain 😊

Did this answer your question?