Last active
December 14, 2015 14:08
-
-
Save victor-falcon/5098198 to your computer and use it in GitHub Desktop.
Query to change wordpress domain
This file contains hidden or 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 @newdomain:='http://nuevadominio.com'; | |
SET @olddomain:='http://localhost:8888/old'; | |
UPDATE wp_options | |
SET option_value = @newdomain | |
WHERE option_name IN ('siteurl','home'); | |
UPDATE wp_posts | |
SET post_content = replace(post_content,@olddomain,@newdomain); | |
UPDATE wp_posts | |
SET guid = replace(guid,@olddomain,@newdomain); | |
UPDATE wp_postmeta | |
SET meta_value = replace(meta_value,@olddomain,@newdomain); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment