Skip to content

Moving a wordpress site…

by manfredtex on May 19, 2011

I just had to move a WordPress site from a Sandbox region to the production region, and forgot that all of the post and page data references to images would be broken.  This site had a great tutorial on what tables needed updating to fix the image links:

UPDATE wp_options SET option_value = replace(option_value, ‘http://www.oldsite.com’, ‘http://www.newsite.com’) WHERE option_name = ‘home’ OR option_name = ‘siteurl’;
UPDATE wp_posts SET guid = replace(guid, ‘http://www.oldsite.com’,'http://www.newsite.com’);
UPDATE wp_posts SET post_content = replace(post_content, ‘http://www.oldsite.com’, ‘http://www.newsite.com’);
UPDATE wp_postmeta SET meta_value = replace(meta_value, ‘http://www.oldsite.com’, ‘http://www.newsite.com’);

After running the 4 SQL statements on the site, everything was up and running just fine.

No comments yet

Leave a Reply

Note: XHTML is allowed. Your email address will never be published.

Subscribe to this comment feed via RSS