Created
January 16, 2013 16:04
-
-
Save bohman/4548309 to your computer and use it in GitHub Desktop.
Simple query to update URLs in a WP install. Useful when moving a site. Wrote it a long time ago, lost it when my computer got stolen, was frustrated, decided to store it here.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SET @oldurl = 'dev1.nollfyranoll.se'; | |
SET @newurl = 'pilgrimsvagen.se'; | |
UPDATE wp_posts SET POST_CONTENT = replace(POST_CONTENT, @oldurl, @newurl); | |
UPDATE wp_posts SET GUID = replace(GUID, @oldurl, @newurl); | |
UPDATE wp_options SET OPTION_VALUE = replace(OPTION_VALUE, @oldurl, @newurl); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment