Skip to content

Instantly share code, notes, and snippets.

@andrezrv
Created June 24, 2013 21:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrezrv/5853890 to your computer and use it in GitHub Desktop.
Save andrezrv/5853890 to your computer and use it in GitHub Desktop.
How to Move WordPress Blog to New Domain or Location
SELECT @old_domain := 'http://www.old-domain.com' , @new_domain := 'http://www.new-domain.com';
UPDATE wp_options SET option_value = replace(option_value, @old_domain, @new_domain) WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, @old_domain, @new_domain);
UPDATE wp_posts SET post_content = replace(post_content, @old_domain, @new_domain);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment