Created
March 13, 2013 13:51
-
-
Save raster/5152274 to your computer and use it in GitHub Desktop.
WordPress URL Changer
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
/* update all post permalinks */ | |
update wp_posts | |
set guid = REPLACE(guid, 'http://oldsite.com', 'http://newsite.com') | |
where guid LIKE '%http://oldsite.com%'; | |
/* update all post content */ | |
update wp_posts | |
SET post_content = REPLACE(post_content, 'http://oldsite.com', 'http://newsite.com') | |
where post_content LIKE '%http://oldsite.com%'; | |
/* update all post meta */ | |
update wp_postmeta | |
SET meta_value = REPLACE(meta_value, 'http://oldsite.com', 'http://newsite.com') | |
where meta_value LIKE '%http://oldsite.com%'; | |
/* update all options */ | |
update wp_options | |
set option_value = REPLACE(option_value, 'http://oldsite.com', 'http://newsite.com') | |
where option_value LIKE '%http://oldsite.com%'; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment