How to move a WordPress website from a subdomain to the root domain in Hostinger

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

Updated 4 weeks ago

If you wish to move your website from a subdomain to the root domain (subdomain.domain.tld → domain.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 Hostinger dashboard.

Step 1 – Copy files from the subdomain to the root domain

  1. In the Websites section, hover over your website that’s connected to the subdomain and click Manage site.
  2. In the left sidebar, click Files → File Manager.
  3. Click the Home folder icon (⌂) at the start of the file path to open all the files within your hosting plan:
  4. Open the domains folder, then open the folder of your website (e.g., subdomain.domain.tld) that you want to copy.
  5. Select all the files, right-click them, and choose Copy or move → Copy to to copy them to the root domain’s folder (make sure the folder is empty):
  6. In the folder list, choose the root domain’s folder (e.g., domain.tld/public_html), or type its name in Find a folder, and click Copy here. 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.

Additional resources