Skip to content

Instantly share code, notes, and snippets.

@bkmacdaddy
Created April 25, 2019 12:18
Show Gist options
  • Select an option

  • Save bkmacdaddy/c2eb4015aabd4cd0ccccb9bae8a15546 to your computer and use it in GitHub Desktop.

Select an option

Save bkmacdaddy/c2eb4015aabd4cd0ccccb9bae8a15546 to your computer and use it in GitHub Desktop.
SQL Queries to run when migrating WordPress
UPDATE wp_options SET option_value = replace(option_value, 'OLD SITE URL', 'NEW SITE URL') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = REPLACE (guid, 'OLD SITE URL', 'NEW SITE URL');
UPDATE wp_posts SET post_content = REPLACE (post_content, 'OLD SITE URL', 'NEW SITE URL');
UPDATE wp_postmeta SET meta_value = REPLACE (meta_value, 'OLD SITE URL', 'NEW SITE URL');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment