Share
Changing the domain name of your WordPress site requires a few steps to ensure a smooth transition. Here’s a guide to help you change your domain name on WordPress, whether you’re using WordPress.com or a self-hosted WordPress.org setup.
For WordPress.com Sites
- Purchase a New Domain:
- Go to your WordPress.com dashboard.
- Click on Upgrades > Domains.
- Search for your new domain name and purchase it.
- Set the New Domain as Primary:
- Once you’ve purchased the new domain, go back to Upgrades > Domains.
- Click on Make Primary next to your new domain.
- This will make your new domain the primary domain for your WordPress.com site.
- Redirect Old Domain (Optional):
- WordPress.com allows you to set up domain forwarding if you want visitors to be redirected from your old domain to your new one.
- Go to Upgrades > Domains, select your old domain, and look for the option to set up domain forwarding.
- Update Site Links and Media:
- After changing the domain, review your content to make sure all internal links are working. You might need to update links if they were set as absolute (including the full domain name).
For Self-Hosted WordPress.org Sites
- Back Up Your Site:
- Before making any changes, create a full backup of your website (files and database) in case anything goes wrong.
- Register the New Domain:
- Purchase your new domain through a domain registrar (e.g., Namecheap, GoDaddy) if you haven’t already.
- Update Domain Settings in WordPress:
- Log in to your WordPress dashboard.
- Go to Settings > General.
- Change the WordPress Address (URL) and Site Address (URL) to your new domain name.
- Save your changes. You might be logged out after this step, so log back in using the new domain.
- Update Domain in the Database (if needed):
- In some cases, you may need to update URLs directly in the database, especially if the site has hard-coded links.
- Use a tool like phpMyAdmin to search for your old domain name in the database and replace it with your new domain name.
- Alternatively, use a plugin like Better Search Replace to perform a database-wide search and replace.
- Redirect Old Domain to New Domain:
- Set up a 301 redirect from your old domain to your new domain.
- If both domains are hosted on the same server, you can add the following code to your
.htaccess
file:apacheRewriteEngine on
RewriteCond %{HTTP_HOST} ^olddomain\.com$ [OR] RewriteCond %{HTTP_HOST} ^www\.olddomain\.com$
RewriteRule ^(.*)$ https://newdomain.com/$1 [R=301,L] - This will redirect all traffic from your old domain to your new domain, preserving SEO.
- Update Google Search Console and Analytics:
- Log in to Google Search Console and add your new domain, verifying ownership.
- Update your Google Analytics settings to reflect the new domain name.
- Check and Update Internal Links and Media:
- Finally, go through your site’s content to make sure all internal links and media files point to your new domain.
By following these steps, your WordPress site will operate under the new domain name without disrupting visitor experience or search engine rankings.