This post is written by .If you wish to write for MoreTricks, you can get in touch using the write for us form

How to Change WordPress Domain Name and Host Without Loosing Traffic

I was running my blog in one host with a free a domain www.triksabc.co.cc.I was never happy with that domain.So I decided to move from www.tricksabc.co.cc to my new domain www.moretricks.com.

But there arise some problem for moving from one domain to another.If I move my contents from older host to new host and by pointing my new domain www.moretricks.com to the new host makes my blog running at the new domain.But the problem is that with my old domain I was having a good traffic about 1000+ visits per day.So I am don’t want to leave that much of visitors.

And also if I leave the old blog as it is it will index in google again and again and will not index my new blog.So the old blog will make head ache for me.

Now what I want to do is I want to get all my old blog traffic to new blog and the old blog will not index further I moved to new domain.If I was moving the host only it was not a problem to drive all my traffic to my new host.But I want to move domain too.

The steps I followed for moving a wordpress blog from one domain to another without losing traffic is explaining below.

Getting Ready to Change your WordPress domain

  1. Copy all the files and folders from old host to new host with the help of any FTP client or your control panel
  2. Upload all your contents to new host using the same facility
  3. Set up your new domain to point your new host.
  4. Don’t change your permalink structure
  5. Download the database using phpmyadmin and import it in your new database.

 

Once you are completed all the above steps.You have to go for the step of updating your database.To make changes to your database follow the steps.

  • You have to change your blogs base URL for that you have to edit your options table.To do so execute the below query in your sql query

UPDATE wp_options SET option_value = replace(option_value, 'http://www.olddomain.com', 'http://www.newdomain.com') WHERE option_name = 'home' OR option_name = 'siteurl';

  • You have to change all your post url s with your new URL since it is stored as absolute URL.Execute the following SQL query

UPDATE wp_posts SET guid = replace(guid, 'http://www.olddomain.com','http://www.newdomain.com');

  • If you are connected your posts to other posts in your blog,you have to update that links also.Execute the below query

UPDATE wp_posts SET post_content = replace(post_content, 'http://www.olddomain.com', 'http://www.newdomain.com');

 

Note:

  1. You have to change www.newdomain.com with your new domain and http://www.olddomain.com with your old domain name
  2. By default the database table name prefix is wp_ if you are changed it,please update your table name in your query
  3. If your database details are changed please update the config.php with the new settings

 

Now the final step you want to follow to redirect your all old url links to the new url.

It is very important to use 301 redirection to inform the search engines to the permanant move of your domain to new domain

So update your .htaccess file using the below code

Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://newdomain.com/$1 [R=301,L]
You can also do it by updating the index.php file
Add the below code to your index.php
<?php
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: http://www.newsite.com" );
?>

 

You can go through the maximum number of links to confirm your change.Hope you are successfully changed the domain and host of your WordPress blog

 

Related Post



Article by

I am,the owner of MoreTricks.com,22 years old guy from Kerala,India.Completed my engineering in Information Technology from Anna university.I would like to spend my free time with internet and Computers.Also I am finding time to spend with my family and friends...Connect me at Facebook and Google+

Author Site: Website     View More Posts from Abdu samad

has written 242 awesome articles for us

2 Comments

  1. Roshan says:

    I would like to move my wordpress installation from a free server to a paid shared hosting service with a new domain.

    While editing the .htaccess file and adding a 301 redirect, is it necessary that, I shoul delete the entire contents in the free hosting?
    If I delete the contente, i mean, the entire wordpress installation, will something get wrong?

    • Abdu ssamad says:

      It is not important to delete the contents from your host.Adding 301 redirection to htaccess is enough to redirect your traffic to new one

0 Trackbacks

    Leave a Reply

    Your email address will not be published. Required fields are marked *