Move WordPress to a new domain / location

Tuesday, May 25, 2010 0:25
Posted in category Wordpress

How to move WordPress to a new location in few steps.

- move files, addapt .htaccess, wp-config.php if needed

- backup database

- run the following queries (replace old_url.tld, new_url.tld with actual data)

 

UPDATE wp_options SET option_value = replace(option_value, 'http://www.old_url.tld', 'http://www.new_url.tld') WHERE option_name = 'home' OR option_name = 'siteurl';

UPDATE wp_posts SET guid = replace(guid, 'http://www.old_url.tld','http://www.new_url.tld');

UPDATE wp_posts SET post_content = replace(post_content, 'http://www.old_url.tld', 'http://www.new_url.tld');

- check if everything is working fine

You can leave a response, or trackback from your own site.

Leave a Reply

Connect with Facebook