How To Change The Domain Name Of Your Wordpress Blog (Without Hurting SEO)
How can you change the domain name for your Wordpress blog, without having to move your site, and without damaging your SEO rankings? This tutorial will walk you through it.

So, you want to change the domain name of your blog? No problem.
In this short tutorial, I will walk you through how to change your existing blog to a different domain name without changing your hosting. We’re not actually moving your blog… just changing the domain which points to it.
Let’s get started…
#1 – Secure Your New Domain
First thing, of course, is to purchase the domain name that you want to use. There’s a good chance that you’re already done this, but if not, take care of it.
I personally recommend Namecheap for buying and managing your domains. If you already use another domain registrar, that’s OK. But, if you’re still deciding, Namecheap is the best option in my personal opinion.
#2 – Set Up Your New Domain With Your Host
For this part, I am going to assume you are using a web host which uses cPanel. Most web hosts use cPanel, so changes are your’s does as well.
[highlight]You do not need to change hosting to do this, however if you’re looking to improve your hosting situation, I most definitely recommend Siteground.[/highlight]
We’re going to set up your new domain as a “parked domain”. You likely also have the option of an “addon domain”. This would be if you are adding additional (separate) websites to your hosting account. A parked domain is a domain which sits on top of another domain. We will be setting up your new domain to point to your existing blog, so therefore it is “parked”.
Here’s how to do it:
- Enter cPanel for your hosting account.
- In the Domains section of cPanel, click on “Parked Domains”.
- Enter your new domain name to create a parked domain. Once you have saved, you will get a confirmation and your new domain will be listed on the screen.
- For the new domain name in the list, click on “Manage Redirection”. Enter the existing (old) domain of your blog there so that the new domain will point to the same site as your existing blog.
But, your domain still won’t work yet. We have to change the domain registration to point to our host.
#3 – Redirect New Domain To Your Host
Your new domain name, by default, will now simply point to some placeholder page from your domain registrar. To make it point to our site, we need to redirect it by changing the nameservers.
Your web host will likely display the nameservers for you right inside your account prominently. In my Siteground account, the servers are shown right in the upper left corner.
You will always have 2 nameservers. If you cannot find them listed, contact your web host to get them.
Now, with those 2 nameservers, you now want to enter these nameserver addresses into the settings for your domain. Go into your domain registrar (remember, I recommended Namecheap).
Go to the management page for your domain name and enter the new nameservers in place of whatever is there already.
Once you have saved your nameservers, you will need to wait a bit for the domain to redirect properly to your blog. Most registrars will tell you to wait up to 24 hours, but in my experience it is typically much faster than this. Often, it will work within just a few minutes.
#4 – Update Your Main Wordpress Domain
At this point, your new domain should be properly pointing to your blog. However, you will see that it is still being auto-corrected to the old domain so it is difficult to tell. The reason is because Wordpress is still configured to use the old domain and it is overriding things.
So, our next step is to tell Wordpress to use a different domain.
The easiest way to do this is right inside of your Wordpress dashboard. Go to Settings > General. You will see two domain fields there.
Most likely, they will be the same. Go ahead and update BOTH fields and save your settings. When you do so, you will most likely be immediately kicked out of Wordpress. Don’t freak out. 🙂 This is simply because you no longer have a cookie in your browser for the domain associated with your blog. You will need to log in again, but this time using the NEW domain name. You may want to clear your browser cache before doing so.
Next, you want to check your configuration file for Wordpress and ensure the domain is set properly. That file is called wp-config.php and you can edit it with an FTP program. If you don’t have an FTP program, you can also edit the file using cPanel.
[highlight]NOTE: With some web hosts (like managed Wordpress hosting like WPEngine), you don’t need to edit the wp-config.php manually (nor should you). Just ensure your new domain is set up inside your account and they do the rest. As always, your hosting support and help you with any specifics regarding how to do this on their setup.[/highlight]
There are only 2 lines in this file you want to pay attention to:
define('WP_HOME','http://www.blogmarketingacademy.com');
define('WP_SITEURL','http://www.blogmarketingacademy.com');
Obviously, change the domain to your new one.
Once you have done this, check your blog and ensure that it is loading up properly with the new domain and that you can log into it.
#5 – Search and Replace
Your database and your blog content is likely going to have a lot of links that are using the OLD domain. To keep things nice and tidy, it is always best to run a search & replace operation to replace all instances of the old domain with the new one.
To do this, install the Search and Replace plugin. Make sure that you run a full database backup before you do anything. This plug-in can help you do that. Or, if your host has a built-in backup functionality, just use that.
You’re searching for all instances of the old domain and replacing with the new domain. This is a simple text search, so it will be finding primarily backlinks that you’ve placed throughout your content. The database table you want to search in, primarily, is wp_posts.
The plug-in will allow you to do a “dry run” which will simulate the changes and show you what it will do without actually doing it. But, eventually, you just bite the bullet and have it do it for real. 🙂
#6 – Re-route Your Old Domain Via 301 Re-direct
A 301 redirect is is a type of URL redirection that tells the search engines that the link has indeed changed and that it needs to index the new version.
We want to set up a site-wide redirect that will tell all incoming links to the old domain to redirect using the new domain. We can do this via the .htaccess file located on your server. .htaccess is a general configuration file that tells your web server what to do, essentially. You will find it right inside the root folder of your Wordpress installation.
Either via FTP or the File Manager in cPanel, open up your .htaccess file.
The typical .htaccess file for Wordpress (if you’re using permalinks) looks something like this:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
You may find other stuff in there, too. But, look for this section. Then, add a few lines to it.
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.davidrisley.com$ [OR]
RewriteCond %{HTTP_HOST} ^davidrisley.com$
RewriteRule ^(.*)$ http://www.blogmarketingacademy.com/$1 [L,R=301]
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
I bolded the 3 new lines that I added. This is back when I changed the domain of this very site from davidrisley.com to blogmarketingacademy.com. All this does is detects calls to davidrisley.com and simply redirects to blogmarketingacademy.com as a 301 redirect.
Be sure to save your .htaccess file when you’re done.
#7 – Tell Google About Your New Domain
At this point, everything should work. All links to your old domain should now properly point to the new domain. Same site… new domain. Yay!
However, let’s go that extra mile and help search engines (mainly Google) change our SEO listings to reflect the new domain. The good thing is that Google makes it pretty easy to manage your own site in search by using Google Search Console.
Now, if you don’t already have your site set up in Search Console, use this as your opportunity to do so. Google has a writeup on how to add a new site property. Just add your site using the new domain. You will need to verify that you actually own the site. They provide many ways to do this, but typically the easiest method is by uploading a file they give you to your web host via FTP. It will be an HTML file with a really weird name. Download that file then re-upload it directly to your web host into the root folder with Wordpress. When you then go to verify your site, Google will check for that file and verify you if it exists.
Once you have added your property to Search Console, Google will be indexing your site using the new domain.
Now, if you were already set up in Search Console, you will be changing your domain. The first step is still to ADD your property (just like above) using the new domain. Then, you will use their change of address tool to tell Google to switch your old domain profile to the new one. You can find details here. As of this writing, you need to switch over to the old version of Search Console to access their change of address tool.
.
At this point, you should be complete with your domain change. Same blog… different URL. And given that you set up your 301 redirects and made the changes with Google, you shouldn’t notice much of a blip in terms of your search traffic.
There are a few more random little things you might want to check in on here:
- If you hard-coded your domain into your theme anywhere, you will want to change those URLs or (preferably) change them to relative URLs.
- Anywhere on social media where you link to your own blog (as in profiles), don’t forget to change them to the new URL.
I hope this was helpful. 🙂
I’ve encountered this way too many times. I think the first step is letting your readers know that you will be moving in advance then doing the necessary steps in order to make sure that they will continue to follow you around.
hey David, I’m about to do this move over. Now my old blog is on one hosting and my new one is in another.
My question is, once I make the move, can I delete the old blog, since I’m not going to be using the old hosting anymore, I will obviously lose that date.
At the end of the day all I want is to keep my old blogs backlinks and make sure it redirects to the new blog.
Thanks homie…
This is great advice for us. However, what if you want to keep your old domain name.
Thanks for sharing on this subject. I’m looking for the best way to change the domain name for a site.
please david i want to move from a freely hosted blog to a self hosted blog how do i do that?
It’s a fairly easy process – there’s a walk through here: http://en.support.wordpress.com/moving-a-blog/
Or you can purchase a guided transfer from inside your dashboard (read more here: http://en.support.wordpress.com/guided-transfer/)
please david i want to move from a freely hosted blog to a self hosted blog how do i do that?
The 301 direct is extremely important. I’m a huge believer though in having multiple domains with 301’s directing it. Domain names are a huge ranking factor!
Awesome tips! I think the 301 redirect is the most important part of it all, without it everything falls apart. Sort of. 🙂
I don’t think wordpress i not a good CMS however if anyone want to move his blog to different domain then your points are very important and effective to understand its functions.
I am so enlightened after reading your comment. I’m happy to take the time to understand your functions, Mrs. web development services.
Well said David! Wonder if you’ll get an answer. I would like to understand the functions too …
Good article by the way.
Something that always trips me up when changing domains for clients is cache plugins, always remember to clear down the cache info too.
Yeah, that helps.
Fantastic article David, however I have a small question for you, when do you actually know that the new domain name has finally been indexed by Google?
And, could it bring any google penalties if you decided to place something else on top of your old domain?
Thanks in advance!
You’ll start to see your search traffic go up again. Plus, you can also monitor things via Google Webmaster Tools.
Nice info, I know I’ve looked for this type of update in the past. I’ll be sharing with my social and newsletter peeps.
Thanks, Chris. 🙂
Good morning Dave,
I do not know if this will be applicable in this instance but, I am going to make this suggestion so that you do not find out about this the hard way and pull your hair out if and when it happens trying to isolate the source of the problem.
My direct experiences with WordPress .htaccess is that for some reason it gets handled differently than most .htaccess files in the sense that any modifications done within the main wordpress .htaccess get written over if you update your “Permalink” settings.
As you know, at some point down the road, you may install a plugin that requires a refresh of the permalink settings and you may potentially get that edit that you have just done overwritten back to the default wordpress .htaccess.
Like I said, I don’t know if this is applicable in this particular instance but I personally just went through this scenario when redirecting the default WP FEED to FeedBurner and I installed a plugin that required that I refresh my permalink settings and it did overwrite my edits with the wordpress .htaccess file.
So the long and short of this is that you should test this scenario out later on this evening and see if it does this Dave. More than likely you will need to put the redirect outside of the default wordpress gig. Just make sure that it is above it or else it will never fire off.
xxxx…..htaccess edits …..xxx
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
I never have WP write the htaccess for me. I always just copy/paste the stuff it gives me and manually edit it. Also, to give WP ability to edit htaccess, you’d need to have write permissions on your blog’s root directory… which isn’t a good idea for security reasons.
Thanks for the clarity on this. I always get asked this question, and its a lot more technical than a small chat can answer. I usually just hire out to get this done, but for those on a budget, this post outlines it all! Thanks!
You’re welcome, Justin. 🙂