Skip to content

Instantly share code, notes, and snippets.

@anabelle
Created May 11, 2012 06:04
Show Gist options
  • Save anabelle/2657837 to your computer and use it in GitHub Desktop.
Save anabelle/2657837 to your computer and use it in GitHub Desktop.
Update WP database after migration to new domain
UPDATE wp_options SET option_value = replace(option_value, 'http://old.tld', 'http://new.tld') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'http://old.tld','http://new.tld');
UPDATE wp_posts SET post_content = replace(post_content, 'http://old.tld', 'http://new.tld');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment