Skip to content

Instantly share code, notes, and snippets.

@ashblue
Created October 4, 2011 01:19
Show Gist options
  • Save ashblue/1260698 to your computer and use it in GitHub Desktop.
Save ashblue/1260698 to your computer and use it in GitHub Desktop.
WordPress MySQL URL Update
# To use this script you must replace the first url http://currentsite.com to http://newsite.com and run it in your MySQL
UPDATE asdf_options SET option_value = REPLACE(option_value, 'http://currentsite.com', 'http://newsite.com');
UPDATE asdf_postmeta SET meta_value = REPLACE(meta_value, 'http://currentsite.com', 'http://newsite.com');
UPDATE asdf_posts SET guid = REPLACE(guid, 'http://currentsite.com', 'http://newsite.com');
UPDATE asdf_posts SET post_content = REPLACE(post_content, 'http://currentsite.com', 'http://newsite.com');
UPDATE asdf_rg_lead SET source_url = REPLACE(source_url, 'http://currentsite.com', 'http://newsite.com');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment