How to move WordPress from subdomain to main domain?

Introduction:

Many people first create a website on a subdomain and later transfer it to the root domain. Moving your website from something like "blog.yourdomain.com" to “yourdomain.com" is an effective approach. This tutorial will show you how to move WordPress website from a subdomain to main domain. It's as easy as moving the files and doing a few tweaks.

Steps to Move WordPress From a Subdomain to the Main Domain

To move WordPress from a subdomain to a root domain, follow these steps:

1. Begin by opening the options table in your database.

2. Locate and edit the siteurl and home options In the options table.

3. Move files from Subdomain directory to main domain directory.

4. Update the permalinks.

5. Verify the website.

Note: Remember to back up all website files and databases on your local system before proceeding.

1. Begin by opening the options table in your database.

Step 1: Login into your website control panel and open PhpMyAdmin.

Step 2: Find the database of your WordPress website. If you're not sure which WordPress database your domain uses, you can find the database name in the wp-config.php file.

Step 3: Click the plus sign next to the database name to open the table list.

Step 4: Select the table ending with _options.

2. Locate and edit the siteurl and home options In the options table.

Step 1: In the _options table locate the siteurl in the option_name table column and select Edit.

Step 2: Replace the option_value URL with the main domain URL of your WordPress site.

For example, if you have WordPress on blog.example.com and want to switch to the root domain example.com, set the option value to https://example.com.

Step 3: Click on the Go button in the bottom right to save your changes.

Step 4: Now, find home in the option_name table column and change the value to the desired value.

3. Move files from Subdomain directory to main domain directory.

Step 1: Login into your control panel and open File Manager.

Step 2: Find out your website subdomain directory and open it.

Step 3: Select all files and move it to the main domain directory.

4. Update the permalinks.

Step 1: Login to your WordPress Admin Dashboard.

Step 2: Navigate to the Settings and click on "Permalinks".

Step 3: Click Save Changes to make sure all subpages on your WordPress site are working properly.

5. Verify the website.

Congratulations! You have successfully moved your WordPress site from a subdomain to your root domain. After following the above steps, it's important to verify that everything is working as intended. To do this, open the website in your browser and verify the various components and functions.

Pay close attention to your website's appearance, navigation menus, internal links, and interactive elements such as forms and contact pages. Also, test different scenarios, such as submitting a form or adding an item to a shopping cart, to ensure that all aspects of your website are working properly.

That’s all.


Was this answer helpful?

« Back

chat