Although domain names shouldn’t be changed often or at all, users sometimes have no choice. Common reasons for switching domain names include moving from a free domain to a paid one, upgrading the top-level domain to a more popular option, rebranding your website, or merging two sites into one. If done properly, the link juice from your old domain will be transferred to a new one, and you’ll incur no SEO penalties. Additionally, your visitors will get redirected to a new URL effortlessly. With that said, let’s get down to brass tacks regarding how to change domain name in WordPress
1. Acquire a domain name
Before you can do anything else, you must buy the domain name you plan to use. There are 2 steps to this:
1. Check whether the domain name is available
Although we’re not affiliated, we found InstantDomainSearch one of many simple ways to verify if your desired domain name is available. When you enter two or more characters, it immediately tells you which domain names are free, and how and from whom to purchase the domain if it’s taken. It’s also a superb way to draw inspiration if your creativity is low.
2. Go through with the purchase
Before you do this, double-check that your web hosting provider doesn’t bundle a free domain name with your payment plan. If they don’t, go ahead and get a new domain from whichever domain name registrar fits your budget.
2. Add the domain name to your account
To use the domain name you just acquired, you need to “park” it to your hosting account. Side note: if you purchased a domain name through WordPress.com, it is already tied to your account. Now, although there are far too many different web-hosting providers, they often use a cPanel to enable user control. Therefore, we’ll demonstrate the process of parking a domain name via cPanel:
- Visit your web hosting service website, access the cPanel, and log in.
- Click on Addon Domains in the “Domains” section.
- Enter the newly obtained domain name under “New Domain Name”. Do not enter https://www in front.
- Leave “Subdomain” empty.
- Make sure “Document Root” points to the root folder of your current website (typically /public_html/).
- Note. You can access your WordPress website via FTP to check the root folder name. Don’t exit – you’ll need it for later steps.
- Click on the Add Domain button.
3. Create a backup of your website
Although not mandatory, this step is strongly recommended; you simply never know what can go wrong. You should already be using one of the backup plugins for WordPress. So, simply make a backup of your website before proceeding further.
4. Add an SSL certificate to your new domain (Recommended)
We strongly suggest that you purchase or acquire a free SSL certificate beforehand. You can do it later, but then you’d have to change http:// to https:// in steps 5, 6, 7, 8, and 9, which is just extra work. Doing this will improve your SEO, boost security on your new domain name, and let visitors enter login credentials or personal information safely. After you finish with the rest of the steps, force SSL in WordPress.
5. Adjust your website URL to reflect changes
We’re finally starting to change the domain name in WordPress. We already demonstrated this procedure under method 4 of our guide on fixing the WordPress logging out problem. Only this time, on top of making the URLs are identical afterward, you must exchange the old domain name with the new one in step 4 of sub-method 1, and step 5 of sub-method 2.
6. Update WordPress database
Go back to the cPanel, and change the domain name in the WordPress database like this:
- Click on the phpMyAdmin option under “Databases”.
- Click on the + icon to expand your database.
- Find and click on the wp_options database on the list.
- Note. This is a default name. Your database might have a different prefix.
- Click on Edit in front of rows that contain siteurl and home under “option_name”.
- Enter your new domain name in both rows in the “option_value” column.
- Click on Go.
7. Add a permanent redirect to the new URL
Now that you’ve officially transitioned to a new domain name, you don’t want to lose your loyal visitors. To ensure that doesn’t happen, you can configure 301 redirects, which will redirect them to the new URL. It also lets search engines know your website has permanently moved locations, and instruct them to pass 90-99% of link juice. There are multiple ways to go about it, but the simplest, in our opinion, is this one:
- Get to your WordPress website root via FTP.
- Find the .htaccess file, right-click on it, and select View/Edit.
- Paste the following code at the top of the page, above
# BEGIN WordPress
:#Options +FollowSymLinks
RewriteEngine on
RewriteRule ^(.*)$ http://www.new-domain-name.COM/$1 [R=301,L]
- Change the placeholder domain name for WordPress with your actual one.
- Save changes, and accept uploading and replacing the .htaccess file.
Note. You should never disable 301 redirects afterward since the only alternative is to manually redirect every URL one by one. Therefore, you shouldn’t cancel your old domain name either.
8. Search and replace broken links
At this point, your old domain name redirects to the new one, and you suggested that search engines treat your new domain name as canonical. However, it can take up to 6 months or more for the transition to finalize. The first way to speed that up while improving SEO and user experience is to find and fix broken links that might have remained behind.
9. Update Google Search Console or Bing Webmaster Tools
With broken links fixed, you should let Google or Bing know you’ve moved on. Before you proceed, make sure both domain names are your verified property. Then, do the following:
Google Search Console
Log in to the Google account liked to your old domain name before doing this:
- Click the gear icon in the top right corner.
- Select Change of Address from the drop-down list.
- Follow the on-screen instructions.
Bing Webmaster Tools
Sign in to your old domain name’s profile before following these steps:
- Click on Diagnostics & Tools in the left sidebar, then Site Move.
- Select “I am moving URLs from this site to another verified site.”
- Fill out the “Source” and “Destination” fields before clicking Submit.