How to move your WordPress Blog to a new domain
Today we are going to learn how to move your WordPress Blog to a new domain. Changing your WordPress installation to a brand new domain is not the easiest of tasks. Unlike a standard website, the URL of your website is hard coded into your WordPress installation, meaning that even if you did copy the files from your WordPress install to a new domain, it would always point straight back at the old domain.
What we will be covering over the course of about three articles which will be produced over the course of this week is a strategic method in which to change your WordPress installation over to a new domain, whilst minimizing the impact that this has on your SEO, and your Google rankings. Part one, which we are seeing today, will cover how to change your WordPress blog to a new domain.
For a blogger, this is quite a scary thing to even attempt. Speaking from my own experience, at the moment, I am currently changing a sister site of Top WordPress Themes over to a new domain giving it a dot com rather than a dot info. The problem with this is that the dot com has no Alexa ranking, and it is not listed in Google at all yet, so the implications of doing this can be very severe. If not done right, I could lose income from Advertising, I could have trouble getting my Google rankings back, and much worse.
In this part, we will be covering the aspect of moving your WordPress files to a brand new domain and making those files work. This involves a few steps which may not entirely make sense until I go into further detail in the next parts to this article, but I do stress, there is a method in this madness, this is what works for me. I am sure that there are many other methods out there, and in part, this is why we have comments on this site enabled, so you can too share from your experience what has and hasn’t worked for you.
First thing that you are going to need to do is deny robots from accessing your new domain so early, as this could affect your search engine rankings. Create a new file on your new domain called robots.txt and include the following lines of text in this file:
User-agent: *
Disallow: /
Now you are going to need to back up all of your files on your current installation on your current domain. This will include your SQL database and your files. Depending on what you have installed on your server, this may be as simple as downloading a backup from your c-panel, or downloading everything via ftp. Once you have everything backed up, upload your WordPress files to your public_html or root on your new domain, and make sure to set all of the same permissions as you had on your existing installation.
Depending on what you have installed on your hosting, or how your SQL is set up, this part may be a little tricky. You need to restore your SQL from the old domain on the new domain. In C-Panel and Direct Admin, this is as simple as creating a new SQL database (this will create a SQL table with the right prefix) then restore your backup on to the new SQL database. If you haven’t done so already, add your user, and then include these details in your wp_config.php file. This will tell your WordPress installation where the database is now located, so that it is not looking for the old installation anymore.
Whilst you have the wp_config.php file still open, we are going to fix that little problem of your WordPress install directing to the old domain. This is a surprisingly easy task. Simply add the following lines in your config file:
define(‘WP_SITEURL’, ‘http://www.example.com’);
define(‘WP_HOME’, ‘http://www.example.com’);
You should now notice that if you navigate to your WordPress on your new domain, it should be working 100%. That is how simple it is, not as complex as it is made to sound. The only thing that needs to be fixed now is changing any links that you have created over the course of your blog being live that direct to the old domain. This is also a very simple fix. Download the Search and Replace plugin, and using this plug in, you can easily replace any references to your old URL with the new URL.
And that is it! That is how to move your WordPress blog to a new domain. Now, let’s not forget that there is a much more important aspect to this, and that is how to redirect from your old domain to the new domain without affecting your search engine rankings, and we will cover this over the next few days in more detail, including what we are going to do with that robots.txt file.
Again, if you have anything to add on this matter, please don’t be scared to use the comments!








