How to Move WordPress Blog to New Domain or Location

Aug 04

For blogger who self-hosts the WordPress blog publishing system on a web hosting server with own registered domain name, sometimes, you may decide to create whole blog on local system then upload it on domain name or you might want to change domain name for new business name or identity. If you decide to change the URL or link location of your WordPress blog due to changing of domain name (such as from http://www.old-domain.com/ to http://www.new-domain.com/) or the blog to another directory location (such as from http://www.domain.com/ to http://www.domain.com/blog/), there are some steps that should be done to ensure the proper migration and no breaking links.

To update WordPress options with the new blog location, use the following SQL command:

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';

If there are any urls which are translated from post slug, and stored in database wp_post table, then you will be suppose to update them too. Those url values are stored inside guid column.

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

And if you have posted any links in blog post having absolute urls then don’t forget to change them :)

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

Related Posts:

  • No Related Posts

5 comments

  1. ldl cholesterol levels /

    Good!Your blog is unique, the website is good information I am sincerely admiring your capability to respond in a short time with such constructive advices. Best wishes to my favorite writer. Thank you for a lot!

  2. chronic myeloid leukemia /

    Hello,Stacks of sobering, tough to acquire information here. This was a excellent piece of writing. We shall be eagerly waiting around. Thanks again.

Leave a Reply