How to Change Your Domain in WordPress (Step-by-Step Guide)
Changing your domain in WordPress might sound intimidating, but it’s actually pretty straightforward—especially if you follow the steps carefully. Whether you’re rebranding, switching to a shorter URL, or moving from a subdomain to a main domain, here’s how to safely update your WordPress site’s domain name.
Before You Start: Backup Everything
Before making any changes, back up your entire website—files and database. You can do this using a plugin like UpdraftPlus, or manually through your hosting control panel (e.g. cPanel).
Step 1: Update WordPress Address and Site Address
- Log in to your WordPress dashboard.
- Go to Settings > General.
- Change the WordPress Address (URL) and Site Address (URL) to your new domain name (e.g.,
https://yournewdomain.com
). - Click Save Changes.
You’ll likely be logged out after this change. Log back in using the new domain.
Step 2: Update Your Domain in the Hosting Settings
If you haven’t already pointed your new domain to your hosting account:
- Update the domain’s DNS settings to match your host’s nameservers.
- Add the domain to your hosting account using Addon Domains or Domain Manager, depending on your host.
- Make sure an SSL certificate is issued for the new domain. You can use Let’s Encrypt or contact your hosting provider for help.
Step 3: Update Links and Media URLs
Your old domain might still be used in internal links or media paths. To fix this:
- Install a plugin like Better Search Replace.
- Use it to search for
https://yourolddomain.com
and replace it withhttps://yournewdomain.com
. - Preview the changes using the “dry run” mode before applying them.
Step 4: Redirect the Old Domain
To preserve SEO rankings and avoid broken links, redirect the old domain to the new one.
Option 1: Using cPanel
- Go to Domains > Redirects.
- Set up a 301 redirect from
yourolddomain.com
toyournewdomain.com
.
Option 2: Using .htaccess
If you’re using Apache, add the following code to your .htaccess
file:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^yourolddomain\.com [NC,OR]
RewriteCond %{HTTP_HOST} ^www\.yourolddomain\.com [NC]
RewriteRule ^(.*)$ https://yournewdomain.com/$1 [L,R=301,NC]
Step 5: Update Google Search Console and Analytics
Don’t forget to:
- Add the new domain to Google Search Console.
- Submit a change of address request.
- Update your domain in Google Analytics under Admin > Property Settings.
Your WordPress site should now be fully transitioned to its new domain. Monitor your site for a few days to ensure everything is functioning properly. If anything breaks, reach out to your hosting support team or a WordPress developer for help.