Web Design Glasgow

Web Strategy Blog

To move a wordpress site from one domain to another, you need to execute the following SQL scripts on the database:
UPDATE wp_options SET option_value = replace(option_value, 'http://www.old-domain.com', 'http://www.new-domain.com') WHERE option_name = 'home' OR option_name = 'siteurl';

UPDATE wp_posts SET guid = replace(guid, 'http://www.old-domain.com','http://www.new-domain.com');

UPDATE wp_posts SET post_content = replace(post_content, 'http://www.old-domain.com', 'http://www.new-domain.com');

This works as of Wordpress 2.8.

(will not be published)

One Response to 'SQL required to move a Wordpress Site to a new domain'

Subscribe to comments with RSS or TrackBack to 'SQL required to move a Wordpress Site to a new domain'.


  1. on November 18th, 2009 at 9:28pm

    Easy enough to remember, always good to be familiar with moving a WP installation to a new domain - i do it all the time with my testing server.

Categories

Archive

Add to Technorati Favorites