Created
February 19, 2017 02:31
-
-
Save nguyentienlong/f37da6a919ed6b44244a83e7dac25abe to your computer and use it in GitHub Desktop.
wordpress - update mysql database when changing 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
UPDATE wp_posts SET guid = replace(guid, 'http://old-domain','http://new-domain'); | |
UPDATE wp_posts SET post_content = replace(post_content, 'http://old-domain', 'http://new-domain'); | |
UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://old-domain','http://new-domain'); | |
UPDATE wp_options set option_value='http://new-domain' where option_name in ('siteurl', 'home'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment