The best way (until now) to change domain name of a WordPress Multisite

Important Note:

If you change the "DOMAIN_CURRENT_SITE" option in your wp-config.php of your multisite, you will not be able to connect to the database (via web and wp-cli)

You should use this tool to change the domain name of your multisite:

Github repository:

1. Clone the git repo into your WordPress root:

$ git clone

2. Open the browser, go to and start searching and replacing:

  • First search and replace your old url to the new one on all the tables (you can click "dry run" to check first, click "live run" to actually make changes):
Old URL:
New URL:
  • Then, search and replace old domain to the new one one on all the main wordpress table (wp_sites, wp_blogs,...):
Old domain:
New domain:
  • After making all the changes, you have an option to delete the script to secure your server: just click "delete" button.

Note: if you find your server is really slow to run this utils, you can try the cli script:

$ php /var/www/Search-Replace-DB/srdb.cli.php -h mydbhost -n mydbname -u mydbuser -p mydbpasswd -s -r

3. Finally, open the wp-config.php and change the "DOMAIN_CURRENT_SITE" option to the new domain:

define('DOMAIN_CURRENT_SITE', '');