Last active
April 5, 2017 05:18
-
-
Save shansana/357c5feb532e2b2e556de1ec5d730fd2 to your computer and use it in GitHub Desktop.
Wordpress Site URL update when changing the host
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 http://oldurlhere with your old site url | |
-- Replace http://newurlhere with your new site url | |
-- Run the Query | |
UPDATE wp_options SET option_value = replace(option_value, 'http://oldurlhere', 'http://newurlhere') WHERE option_name = 'home' OR option_name = 'siteurl'; | |
UPDATE wp_posts SET guid = replace(guid, 'http://oldurlhere','http://newurlhere'); | |
UPDATE wp_posts SET post_content = replace(post_content, 'http://oldurlhere', 'http://newurlhere'); | |
UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://oldurlhere','http://newurlhere'); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment