Changing the Domain Name on WordPress Multi-site
Date Posted: 25-12-2017
In this post we will explain how to change site url in the new moved domain.
Step 1: Open the wp-config.php and edit define(‘DOMAIN_CURRENT_SITE’, ‘newdomain.com’);
define('WP_DEBUG', false); define('WP_ALLOW_MULTISITE', true); define('MULTISITE', true); define('SUBDOMAIN_INSTALL', false); define('DOMAIN_CURRENT_SITE', 'newdomain.com'); define('PATH_CURRENT_SITE', '/'); define('SITE_ID_CURRENT_SITE', 1); define('BLOG_ID_CURRENT_SITE', 1);
Step 2: Open mysql or phpmyadmin and run the following query.
UPDATE wp_options SET option_value = replace(option_value, 'http://olddomain.com', http://newdomain.com') WHERE option_name = 'home' OR option_name = 'siteurl'; UPDATE wp_posts SET guid = replace(guid, 'http://olddomain.com','http://newdomain.com'); UPDATE wp_posts SET post_content = replace(post_content, 'http://olddomain.com', http://newdomain.com'); UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://olddomain.com','http://newdomain.com'); UPDATE wp_site domain='http://newdomain.com' where id=value UPDATE wp_blogs SET domain='http://newdomain.com' WHERE blog_id=value;