Skip to content

Instantly share code, notes, and snippets.

@timkinnane
Created April 7, 2013 23:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timkinnane/5333108 to your computer and use it in GitHub Desktop.
Save timkinnane/5333108 to your computer and use it in GitHub Desktop.
Wordpress, find and replace url in database.
UPDATE wp_options SET option_value = REPLACE (option_value, 'http://oldurl','http://newurl');
UPDATE wp_posts SET guid = REPLACE (guid,'http://orldurl','http://newurl');
# Change "wp_" to your database's table prefix
# Change oldurl, newurl (oldurl is the one in the database already)
UPDATE wp_options SET option_value = REPLACE (option_value, 'http://oldurl','http://newurl');
UPDATE wp_posts SET guid = REPLACE (guid,'http://orldurl','http://newurl');
# Change "wp_" to your database's table prefix
# Change oldurl, newurl (oldurl is the one in the database already)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment