Last active
August 29, 2015 14:04
-
-
Save kane-c/55fe45008ff6ebe2fa2e to your computer and use it in GitHub Desktop.
The SQL required for changing a WordPress install's domain
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
-- Replace new-domain and old-domain as with your values | |
SET @old_domain = '', | |
@new_domain = ''; | |
UPDATE `wp_options` | |
SET `option_value` = REPLACE ( | |
`option_value`, | |
@old_domain, | |
@new_domain | |
); | |
UPDATE `wp_posts` | |
SET `post_content` = REPLACE ( | |
`post_content`, | |
@old_domain, | |
@new_domain | |
), | |
`guid` = REPLACE ( | |
`guid`, | |
@old_domain, | |
@new_domain | |
); | |
UPDATE `wp_postmeta` | |
SET `meta_value` = REPLACE ( | |
`meta_value`, | |
@old_domain, | |
@new_domain | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment