=========
QUESTION
———
I am changing the domain name or url of my web site, how do I update the database entries to the new url?

 

=========
ANSWER
———
Connect to the database, and run the query listed in the EXAMPLES section

 

=========
EXAMPLES
———

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_options SET option_value = replace(option_value, ‘http://www.OLDDOMAIN.com’, ‘http://NEWDOMAIN.com’) WHERE option_name = ‘home’ OR option_name = ‘siteurl';

UPDATE wp_posts SET guid = replace(guid, ‘http://www.OLDDOMAIN.com’,’http://NEWDOMAIN.com’);

UPDATE wp_posts SET post_content = replace(post_content, ‘http://www.OLDDOMAIN.com’, ‘http://NEWDOMAIN.com’);

UPDATE wp_postmeta SET meta_value = replace(meta_value,’http://www.OLDDOMAIN.com’,’http://NEWDOMAIN.com’);

 

=========
APPLIES TO / KEY WORDS
———
Wordpress
Find and Replace

 

=========
REF
———

 


http://www.anysitesupport.com/wordpress-update-domain-name/
http://anySiteHosting.com