Skip to content

Instantly share code, notes, and snippets.

@ianthekid
Created February 15, 2015 19:08
Show Gist options
  • Select an option

  • Save ianthekid/17eee00d0d19045e31a7 to your computer and use it in GitHub Desktop.

Select an option

Save ianthekid/17eee00d0d19045e31a7 to your computer and use it in GitHub Desktop.
Wordpress update database for staging
/*
* Wordpress Staging/Development
*/
UPDATE wp_options SET option_value = REPLACE(option_value, 'ORIGINAL_URL', 'NEW_URL');
UPDATE wp_postmeta SET meta_value = REPLACE(meta_value, 'ORIGINAL_URL', 'NEW_URL');
UPDATE wp_posts SET guid = REPLACE(guid, 'ORIGINAL_URL', 'NEW_URL');
UPDATE wp_posts SET post_content = REPLACE(post_content, 'ORIGINAL_URL', 'NEW_URL');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment