How to change a WordPress Multisite primary domain.

wp-config.php

<?php
$domain = "your domain";
define('WP_HOME', 'http://'.$domain.'//');
define('WP_SITEURL', 'http://'.$domain.'//');
define( 'WP_ALLOW_MULTISITE', true );
...
...
define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', false);
define('DOMAIN_CURRENT_SITE', $domain);
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);

/* That's all, stop editing! Happy blogging. */  // <--Before this line

MySQL (Ref: https://wpengine.com/support/how-to-change-a-multi-site-primary-domain/)

  • wp_options: value of “siteurl”, “home”.     (http)

  • wp_#_options: each sub-blogs, also value of “siteurl”, “home”.      (http)

  • wp_site: value of “domain”.

  • wp_sitemeta: value of “siteurl”.   (http)

  • wp_blogs: all column “domain”.

Be the first to comment

Leave a Reply

Your email address will not be published.


*