Skip to content

Instantly share code, notes, and snippets.

@lewismorris
Last active January 16, 2018 18:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lewismorris/5270666 to your computer and use it in GitHub Desktop.
Save lewismorris/5270666 to your computer and use it in GitHub Desktop.
Wordpress mySQL Search/Replace
UPDATE wp_posts SET post_content = REPLACE(post_content, 'old.server.com', 'new.server.com');
UPDATE wp_posts SET guid = REPLACE(guid, 'old.server.com', 'new.server.com');
UPDATE wp_options SET option_value = REPLACE(option_value, 'old.server.com', 'new.server.com');
UPDATE wp_postmeta SET meta_value = REPLACE(meta_value, 'old.server.com', 'new.server.com');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment