Created
February 15, 2013 01:55
-
-
Save hullen/4958058 to your computer and use it in GitHub Desktop.
Wordpress SQL Update for alter the URL changes when you publish your site.
This SQL helps you to speed up update yours url values in tables of the database.
Just replace your old url by your new url of the site. Code helped by my friend @akbortoli
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 wp_options SET option_value = replace(option_value, 'http://www.oldsite.com', 'http://www.newsite.com') WHERE option_name = 'home' OR option_name = 'siteurl'; | |
UPDATE wp_posts SET guid = REPLACE (guid, 'http://www.oldsite.com.br', 'http://www.newsite.com'); | |
UPDATE wp_posts SET post_content = REPLACE (post_content, 'http://www.oldsite.com', 'http://www.newsite.com'); | |
UPDATE wp_postmeta SET meta_value = REPLACE (meta_value, 'http://www.oldsite.com','http://www.newsite.com'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment