If you’re thinking about changing your domain name for your existing WordPress website, you’ll need to follow some basic steps to make sure you do it right.
In addition to causing delays and headaches, if you don’t do things right you could permanently ruin your search engine rankings and cause a variety of other disastrous consequences.
In this guide, we’ll go over some of the basics and also show you some best-practices to ensure everything goes smoothly and that your website doesn’t suffer any major negative consequences.
Why would I need to change my WordPress domain name?
There are a number of reasons why you might need to change it. If you find yourself in any of the situations, it may be time to proceed with the change:
- The name of the company is changing
- You found a new domain name that works better for you
- Your site or content is being absorbed by another website
- You let your domain name expire and somebody else sniped it
There are some other possibilities out there, but these are the main ones and they are perfectly valid.
Just know that you shouldn’t take this decision lightly, as it will have some important ramifications.
What are the common pitfalls of changing my WordPress domain name?
Below are some of the common problems and mistakes people run into when changing their domain.
- Not replacing all URL instances in the database
- Not checking the files for old URL instances
- Caching issues
- Not setting up redirects
- Using domain forwarding instead of SSL redirect with .htaccess hosting
- Letting the old domain expire
Below, we’ll show you what you should do and how to avoid these mistakes.
How should I prepare for a WordPress domain name change?
Before making the change, you’ll want to carefully plan out how everything will go. Below are some of the steps you may want to take in preparation for the change.
- Decide what the new domain will be and make sure you own it and have access to where it is registered
- Make sure both domains are registered for at least several months into the future
- Verify that you have access to the DNS settings of both the old domain and new domain
- Set up hosting for the new domain
- Prepare redirect hosting for the old domain
- Inform relevant parties that a change is coming
Note that email is not covered in this guide, but you’ll want to think carefully about how you’ll handle any email address changes, too.
Once you’ve got all this planning in place, it’s time to proceed.
Setting up the new domain with the WordPress website
In this step, you’ll essentially be migrating the existing website to the new domain. This doesn’t mean everything will be “live” yet, but the new site can and should be good to go long before you actually turn everything on.
You’ll need to migrate the files and database using your method of choice. There can be a lot to this, so make sure you work with someone who knows what they are doing.
Then, set up your SSL certificate if applicable. Depending on your hosting setup, this could be tricky. But it’s helpful to have it ready ahead of time so there are no problems later.
Replace all instances of the domain at the new location in both the database and files
It’s critical to go through the entire website and replace all instances of your old domain with the new one. Some hosts have a tool to replace all instances in one go, which may work.
If not, I would use a third-party plugin just to make sure. Two that we use regularly are Go Live and WP Migrate Lite. These plugins work a little differently and replace all instances in the database.
You may want to consider running them even if your host has their own tool, because often, no one tool can take care of all instances.
Some plugins such as Elementor and some slider plugins have their own built-in tool that will take care of the data within their settings. For reasons I am unaware of, they often store data in a way that can’t be updated via a third-party tool and you need to use their own tool, so this isn’t optional.
Once you’ve gone through and attempted to replace all instances, check the page source of your site on the frontend and search for instances of the old URL. If you are still finding them, you’ll need to try another method to replace those, because you obviously haven’t caught them all.
Set up redirect hosting for the old domain
It’s critical to set up the proper redirect hosting for your domain. Otherwise you’ll lose all of the traffic and rankings you’ve worked so hard for.
Regular “domain forwarding” isn’t enough. This is what is offered at most registrars free with domain registration. The problem is, it doesn’t include SSL which means that traffic won’t actually be redirected, and visitors will face a big warning message when trying to visit you.
Additionally, you need to host the old domain where you can set up an .htaccess file which will filter traffic to the corresponding pages on your new domain. Otherwise, they’ll all go to your home page, regardless of the page they wanted.
This is not only horrible for usability and will lead to people abandoning your website, but it is also absolutely devastating for your search engine rankings, which will plummet.
Have this all set up so that when you decide to officially switch to the new domain, all you have to do is point the DNS for the old domain to the redirect hosting and you’re good to go.
As a side-note: it’s generally recommend to leave this redirect active for at least a couple years. I would actually recommend leaving it longer than that if you’re a legitimate business. Make sure the old domain is registered and won’t expire any time soon.
Preventing Caching Issues
You’ll want to watch out for issues with caching. The best way to prevent this is to completely disable all caching – both when exporting the website and on the new server – before any kind of migration.
Many of the better plugins won’t have any issues, but it can be unpredictable. And caching that is built-in to your hosting may be very difficult to deal with.
Make sure you learn how your caching method works and how to disabled and/or reset it.
Some hosts, notably WP Engine, have very complicated systems, and it can be extremely difficult to deal with when switching to another host. Make sure you look up specific instructions for that task.
How to officially switch to your new WordPress domain name
By now everything should be ready to go, and there shouldn’t be much left to do but “go live”.
Here’s what I would do and in the order I would do it.
Point the DNS for the NEW domain to the live server you’ve prepared, and make that site live. You can do this up to a few days early if you like, but you should generally be fine doing it up to 12 hours early. There’s no penalty for briefly having duplicate content, so don’t worry too much about that.
Then, point the DNS for the OLD domain to your prepared redirect server. This will put everything into motion and make it “live”.
Test to make sure it’s all working. You’ll want to test not only the old home page, but also sub-pages. Make sure, for example, that your “contact” page brings you to the “contact” page on your new website. Test other misc. URLs.
One trick I do is to search for the domain name in Google, e.g. go to Google and type “pagecrafter.com” (your old domain) and click through the first couple pages of links. Make sure they bring you where they should.
Finally, once everything looks good and is working properly: announce the change. Wherever you need to do that, tell everyone to update their records and let them know that you now have a new domain name.
Other important tasks post-switch
Now that your new domain is live and traffic is being redirected properly, you’ll probably want to attend to a variety of other housekeeping tasks. Most of these are beyond the scope of this article, but here are just a few examples of things you’ll probably want to do:
Changing Google Analytics and Search Console to the new domain
Updating your domain for any other third-party connected services
Updating email addresses, if necessary
Updating email signatures
Making sure your domains won’t expire (both the new domain AND old domain)
Going throughout the web and updating your domain in places like Google maps, Yelp, other business directories, and wherever else you can find instances of the old domain
With that, you should have properly migrated your WordPress domain. It may seem like a lot, but it’s absolutely critical that all of these things are in place so you don’t end up ruining your business.
We’re happy to handle most of the migration for you. Please fill out the form below with your information and we’ll get back to you.