Skip to content

Instantly share code, notes, and snippets.

@messified
Last active May 4, 2016 16:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save messified/7e6b3ef80f84c7a2eb8d to your computer and use it in GitHub Desktop.
Save messified/7e6b3ef80f84c7a2eb8d to your computer and use it in GitHub Desktop.
WordPress DB Migration Queries

Useful WordPress Queries

Site / Home URLs

UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldsiteurl.com', 'http://www.newsiteurl.com') WHERE option_name = 'home' OR option_name = 'siteurl';

Update content Guid

UPDATE wp_posts SET guid = REPLACE (guid, 'http://www.oldsiteurl.com', 'http://www.newsiteurl.com');

Update post content URLs

UPDATE wp_posts SET post_content = REPLACE (post_content, 'http://www.oldsiteurl.com', 'http://www.newsiteurl.com');

More Useful Queries Here WP Migration Queries

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment