change primary domain name in wordpress


sometimes it may be necessary to change the domain name of your wordpress blog. Instead of reinstalling wordpress, we can modify the current database to accomodate the changes. run the following query:

Back up your db. then


use wordpress_db;

update wp_site set domain='newdomain.com';

update wp_blogs set domain='newdomain.com';

update wp_options SET option_value = 'http://newdomain.com' WHERE wp_options.option_id =1;

update wp_options SET option_value = 'http://newdomain.com/wp-content/uploads' WHERE wp_options.option_id =17;

update wp_options SET option_value = 'http://newdomain.com' WHERE wp_options.option_id =46;

Like it.? Share it:

Comments are closed.