How to Relocate your Wordpress Blog to a New Domain Name

Please check out my latest Wordpress plugin Related Websites!

Making the decision to move my blog from http://www.courseladder.com to http://www.golfballdriver.com was a big one, and a good one, and it taught me a lot about learning how to relocate your Wordpress blog to a new domain name under the same hosting provider. Course Ladder suited me for a while, but from an SEO standpoint it was not a good domain name for me to stick with over a long term and I am glad for the change.

Golf Ball Driver is better than Course Ladder because…

  1. “Golf” in the domain name
  2. All domain words are highly relevant
  3. Direct golf product tie in
  4. It makes sense. What am I? A golf ball driver!
  5. The double entendre between the products and the persona.

gbd

What You Need to Do:

The first thing that you want to do is to create a new add on domain for the new domain name.

The next step in the process is to copy the entire contents of the old domain folder, which includes your entire Wordpress blog, into the brand new domain folder within the same hosting area.

Next, there are a couple of SQL statements that you need to run:

* First, to update your WordPress options with the new location of your blog, the following SQL command needs to be put in:

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

Next, you are going to need to fix the URLs of your posts and pages on WordPress. The URL values are stored as absolute URLs rather than as relative URLs, so you need to use the following SQL query to change them.

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

If you have linked internally at any point within your blog posts or your pages using absolute URLs, then this links are going to be pointing to the wrong locations after you change the location of your blog. You need to use the following SQL commands in order to fix all of the internal linking in all of your Wordpress posts and pages.

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

Once you have put all of these SQL queries into action, the next step is to browse through as much of your WordPress blog as you can in order to make sure that everything is in good working order. You are also going to need to login to your WP Administration section because the authentication cookie will become invalid when you change domains.

Now you can delete the old folder contents so that your blog is not appearing in two different places.

In order to 301 redirect all old links from the old domain to the new domain, place a single file .htaccess into the now empty folder. You want to be sure to 301 redirect else you will permanently lose any hard earned links you have developed. Here is what the file should contain:


RewriteEngine on
RewriteCond %{HTTP_HOST} ^.old-domain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.old-domain.com
RewriteRule ^/?(.*)$ "http://www.new-domain.com/$1" [R=301,L]

Finally, update your Wordpress blog to have the new blog name in your title.

The process is relatively simple once you have a feel for what needs to be accomplished. Above all else, it is vital that you avoid upsetting your linking structure in the process. Make sure that all of your links are still valid and working after you make the big move, and your blog should be just fine, and more importantly, better off with an improved domain name.

Originally posted 2009-02-05 09:45:03. Republished by Old Post Promoter

[Post to Twitter] Tweet This Post 

Blog Traffic Exchange Related Posts
  • traffic10 Benefits of Hosting your Own Blog If you want to create an edge over many of the other bloggers on the web, then one of the best things that you can do is host your own blog. There are a number of benefits of hosting your own blog over having some other service host your blog.......
  • rssWhat is an RSS Feed and Why Syndicate Your Blog? Blog feeds or RSS feeds allow for feed readers to access a site that automatically looks for new content from all of their favorite blogs. By syndicating your blog through an RSS feed you can allow your readership to access all of your new blog posts without requiring them to......
  • advertiseHow to Get Advertisers for Your Blog If you've got a blog with enough traffic, you might want to monetize the space by drawing in advertisers. If your blog is new, it's going to be a hard sell to get people to want to advertise on your blog but you can do it. Whether your blog is......
  • readersKeep Readers Coming Back to Your Blog If you have a blog, you want to keep readers coming back. You can attract readers in a variety of ways, but keeping them is a little harder. You may end up high in the search engines for tons of keywords and pull in tons of unique page views. But......
  • linkPermalink Structure without Dates The structure behind WordPress is generous enough to allow for built in SEO advantages which come with building pages that static web page building and other blogging software cannot afford you. By using WordPress, you already have an advantage over bloggers, but only as long as you are willing to......
Blog Traffic Exchange Related Websites
  • Moolanomy ThemeHow to Find the Right WordPress Theme Whoa, is there such a thing as the wrong WordPress theme? Sadly, the answer is yes. There are literally thousands of themes out there. There are some really good ones, and inevitably, there are some bad ones too. Where to find WordPress themes Before I show you what make a......
  • Default Rate: It's Not Just If a Loan Defaults, But When I had a very interesting email exchange with RGF.  (I emailed him after using his forum posts in articles last week). Here is a portion of that email exchange on default rates over time and their affect on yield. RGF: Default rate:  It's not just if a loan defaults, but......
  • Weekend Reading: August 10, 2008 Last night, I switched Moolanomy over from the custom theme I wrote to a magazine-style theme based on Mimbo by Darren Hoyt. The most significant changes occur on the front page where you'll now see magazine layout with Lead Story and Featured section. You can also see most recent articles......
  • soapboxBlogging for Business Pt 1 Business blogs are quickly becoming the "in" thing, at least as far as corporate communication is concerned. "Blog" is short hand for weblog or web log, which is an online public diary that is updated on a regular basis. Some web logs are updated daily, while others see updates every......
  • Fantasy Link Exchange Fantasy link exchange is when you name (with links) the 35 blogs with which you would like to exchange blogroll links.  In an ideal world they find out about your desire from Technorati or PFBlogs.org or sheer luck and consummate the exchange. The Simple Dollar I Will Teach You To Be......
If you liked this article, vote for it on del.icio.us and stumbleupon.



Categories:

Blog Tips, Blogging, Content Ideas, Domain/Host, Platform, SEO, WordPress



Tags:

, , , , , , , , , , , , , , , ,


8 comments ↓
#1 Augie on 03.18.09 at 7:00 am

What is the reason for changing the folder where the contents resides? Wouldn’t this work without doing that?

#2 kevin on 03.18.09 at 10:34 am

I changed folders so that I could have a clean ht access file in the old directory. To me this made for a cleaner and more maintainable final product.

#3 Augie on 03.18.09 at 11:40 am

For some reason that didn’t work for me. I actually ended up using two folders. I had the old site in the old folder and then set the new site in a new folder. I then used a 301 to redirect in the .htaccess from the old site to the new site. The following command will preserve the path so if you type oldsite.com/dir/file.ext it will 301 redirect to newsite.com/dir/file.ext.

RedirectMatch 301 ^/?(.*)$ http://newsite.com/$1

#4 Patrice on 04.08.09 at 6:45 am

Hello! I just moved my blog following the steps listed in your post. That was easy! Thanks.

However, I don’t understand this part:
“You are also going to need to login to your WP Administration section because the authentication cookie will become invalid when you change domains.”

What should I do exactly? where are my authentification cookie in my WP Admin section?

Thanks lot!

#5 kevin on 04.08.09 at 8:11 pm

@Patrice

I was saying in a very wordy way. That wordpress was going to ask for you user/pass to gain access to the admin section.

Glad it helped you!

#6 Agus Setiyawan on 04.14.09 at 9:23 pm

Thank’s for your information.

#7 will on 04.23.09 at 12:55 pm

hey… this is great! but i do have 1 question:

where do i “run SQL queries” from?

i was looking around in cpanel, and couldn’t find where i could add queries, only new databases.

thanks a bunch :)

- will

#8 Akhil Yadav on 06.22.09 at 2:55 pm

Thanks for directing me to this post Kevin
this was really helpful
:)

Leave a Comment