This article describes how to change the primary domain in a WordPress multisite installation. You may need to do this, for example, after migrating a WordPress site to a new server.
To change the primary domain in a WordPress multisite installation, you must update several database entries and a setting in the wp-config.php file. The following procedures demonstrate how to do this.
To change the primary domain for WordPress multisite, you must first update several database locations. To do this, follow these steps:
phpMyAdmin opens in a new page. In the left sidebar, click the WordPress database (in the image below the database is named example_wp922). A list of tables in the database appears:
In the left sidebar, click the wpXX_blogs table:
In the domain column, for each row, double-click the value, type the new domain name, and then press Enter:
In the left sidebar, click the wpXX_options table:
In the siteurl and home rows, in the option_value column, double-click the value, type the new domain name, and then press Enter:
In the left sidebar, click the wpXX_site table:
In the domain column, double-click the value, type the new domain name, and then press Enter:
In the left sidebar, click the wpXX_sitemeta table:
In the siteurl row, in the meta_value column, double-click the value, type the new domain name, and then press Enter:
If you have added additional sites, then the database contains additional tables named wpXX_2_options, wpXX_3_options, and so on. For each of these tables, change the siteurl and home values as you did in step 7.
To update the wp-config.php file, follow these steps:
define( 'DOMAIN_CURRENT_SITE', 'example.com' );
For more information about the WordPress multisite feature, please visit https://wordpress.org/documentation/article/create-a-network/.
Subscribe to receive weekly cutting edge tips, strategies, and news you need to grow your web business.
No charge. Unsubscribe anytime.
Did you find this article helpful? Then you'll love our support. Experience the A2 Hosting difference today and get a pre-secured, pre-optimized website. Check out our web hosting plans today.
We use cookies to personalize the website for you and to analyze the use of our website. You consent to this by clicking on "I consent" or by continuing your use of this website. Further information about cookies can be found in our Privacy Policy.