Move WordPress to new Domain

From TomSchaefer.org Wiki

Jump to: navigation, search

WordPress should be portable, it shouldn’t matter what domain it is running on. WordPress doesn’t work this way unfortunately and although it may in the future you will have to move everything by hand.

Well to make this take simple, easy, and fast I have provided three easy SQL query to help your task of moving WordPress.

   UPDATE wp_options SET option_value = replace(option_value, 'http://www.old-domain.com', 'http://www.new-domain.com') WHERE option_name = 'home' OR option_name = 'siteurl';

This will change your blog location and allow you to login from your new domain

   UPDATE wp_posts SET guid = replace(guid, 'http://www.old-domain.com','http://www.new-domain.com');

This will fix post links and…

   UPDATE wp_posts SET post_content = replace(post_content, 'http://www.old-domain.com', 'http://www.new-domain.com');

This will fix attachment links.

Personal tools