Table of Contents
How to change a domain name on WordPress: Quick workflow
Here is a concise guide on how to change a domain name on WordPress:
Changing the Domain Name in WordPress
- Log into your WordPress dashboard and go to Settings > General
- Update the following fields with the new domain name:
- WordPress Address (URL)
- Site Address (URL)
- Click on Save Changes at the bottom of the page
Setting Up Redirects and Notifying Search Engines
- Set up 301 redirects from your old domain to the new one to preserve SEO value and avoid broken links
- You can do this by adding code to your .htaccess file
- Example code:
#Options +FollowSymLinks RewriteEngine on RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
- Submit your new sitemap to Google Search Console to inform search engines about the domain change
- Notify your users that you’ve changed your domain name and it may take 24-72 hours to fully propagate
Updating DNS Records
- If your domain is registered elsewhere, update the DNS records to point to your web host’s servers
- Most DNS changes take effect within an hour but can sometimes take up to 48 hours to update globally
The key steps are updating the WordPress Address and Site Address, setting up redirects, notifying search engines, and updating DNS records if needed. Proper planning and execution is important to minimize downtime and broken links when changing your WordPress domain name.
Reasons For a New Domain Name
There are many legitimate reasons for a new domain. Many projects will have to go under a new name and that means a new site address to match. Two of the most common scenarios are:
Rebranding: You can rebuild your company’s image from the ground up and a new domain name will broadcast your improved look to the world.
You’ve probably visited the old domain name called twttr, but everybody has accessed Twitter. The successful rebranding of prominent domains like this shows that change can be good.
Domain Extension Change: In some cases, your project may be running on a subdomain like mywebsite.wordpress.com or you may be using an extension like .mobi or .shop. These site addresses might not be resonating well with your audience.
Swapping to a different extension or new site address URL can breathe new life into your WordPress domain and make it even easier to reach a wider audience.
What To Know Before You Create A New Domain Name
Changing your WordPress domain name is simple, but there will be the occasional need to adjust your website’s PHP code. This code is essential to the operation of your website and mistakes made there could bring your domain to a halt. Some quick prep work before you start will guarantee the process goes smoothly.
- Before doing anything, create a full backup of your website. Do this either manually by exporting your database or by using one of many backup plugins. Some reliable options are Updraftplus, BlogVault, and VaultPress.
- Buy and Register your new Domain name by pointing it to the correct name servers.
- Have a File Transfer Protocol (FTP) client. The FTP will allow you to access your server directly from your computer. They’re easy to use but be prepared for some learning curves. We recommend FileZilla, a great FTP for beginners to brush up on their FTP skills.
- Head to Google Domains and type in your preferred new domain name. The checker will tell you if that option is available and it will offer some alternative websites name suggestions in case that domain is already taken.
How to Change The Domain Name On WordPress
To make use of your new domain, add it to your hosting through the cPanel.
- In the cPanel click on the Addon Domain
- Enter your new domain address, subdomain, and document root.
- Click Add Domain.
- Either download your backup file or directly copy your previous folder to the new domain folder.
- If you’re migrating to a new hosting service follow these instructions to download your backup and add it to your FTP using your cPanel.
-
- Inside the cPanel go to your Dashboard > Settings > General.
- Replace your current WordPress Address (the URL used to visit your site) and Site Address (the URL of your core files) with your new domain.
- Hit Save Changes to finish.
- Open your new domain folder.
- Edit the wp-config.php file and define the site URL and homepage for your new domain. This will reflect the changes you’ve made in the WordPress settings. Access your wp-config.php file from the cPanel file manager or by using FileZilla.
-
- Go to cPanel > Files > File Manager
- Choose the domain and click Go To File Manager
-
- Locate the wp-config.php file in the public_html folder
- Right-click and select Edit
- In the following snippet, replace http://yoursitename.com with your new WordPress domain name, then insert it into the file and press Save & Close.
You can use the following code:
define('WP_SITEURL', 'http://newdomain.com');
define(‘WP_HOME’, ‘http://newdomain.com’);
Setup a Permanent 301 Redirect
Now that you’ve successfully changed to your new WordPress domain name, but what if someone visits the old one? Will they just see a blank page? You don’t want to lose even a single visitor. We recommend keeping your old domain active for a while to allow users and search engines time to recognize your new home.
But that’s only a temporary solution. The long-term fix to guarantee that no traffic gets lost during your rebranding efforts will be to set up a permanent 301 redirect from your old domain to the new one.
This will help you optimize your website for search engines and users alike by redirecting anyone who lands on your old website, sending them instead to your new one. Here’s how:
- Log into your cPanel
- Click on the File Manager
- Open your website folder.
- Go to the .htaccess file and click on Edit.
- Go to cPanel > Files > File Manager
- Select your old domain and click Go to File Manager.
- Find the .htaccess file in the public_html directory and right click it
- Select Edit
- Insert the following code, after replacing http://yoursitename.com with your new domain, then press Save & Close.
If you need to put the code in the wp-config file to change the site address or domain name, do the following:
- Log into your WordPress Admin Dashboard
- Navigate to Settings > General
- Under general settings find two fields named WordPress Address URL and Site Address (URL)
- Change the old domain name to the new one
- Click Save Changes to finish the process.
Using plugins to help you with the domain change
Do you need help with website backups or URL redirection? I’m sure you can find a plugin to solve your problem. Here are several widely used choices that can assist you in changing your WordPress domain and doing the stated actions.
Duplicator
When it comes to moving and backing up WordPress sites, Duplicator is widely considered the best option. If you’re also switching hosts alongside your domain shift, this tool will come in extremely handy for backing up and transferring your website.
When you use Duplicator, your whole WordPress installation, including all of its plugins and themes, will be downloaded as a single.zip file, which you can then use as a backup or to facilitate a seamless, interruption-free migration.
Backup Guard
You may back up your website’s files with Backup Guard, another choice for backups and migrations.
If you purchase the pro version of Backup Guard, the procedure of moving your website to a new domain will be handled automatically, saving you time and stress.
Update your domain name with Google Analytics and other tracking tools
Your Google Analytics profile must be updated next. Google Analytics is the most popular and effective free service for analyzing site traffic, user behavior, and conversions.
If you go to “Admin,” then “Property Settings,” then “Default URL,” you can easily change it.
Changing an existing property is preferable to starting from scratch because it facilitates future comparisons of traffic and historical data (particularly if the URL structure is maintained).
FAQ on Changing the Domain Name on WordPress
What steps are involved in changing a domain name on WordPress?
Changing a domain name on WordPress involves several key steps. First, back up your website. Then, update the domain in your WordPress settings and DNS configuration. Finally, set up 301 redirects and update your SSL certificate to ensure a smooth transition.
Will changing my domain affect SEO?
Yes, changing your domain can affect SEO. To minimize impact, set up proper 301 redirects, update your SEO settings, and inform search engines about the change using tools like Google Search Console. Keep an eye on your website traffic and adjust as needed.
How do I update my WordPress URL settings?
To update your WordPress URL settings, navigate to the WordPress dashboard, go to Settings > General, and change the WordPress Address (URL) and Site Address (URL) to your new domain. Save changes and ensure all links are updated to reflect the new URL.
What is a 301 redirect, and why is it important?
A 301 redirect is a permanent redirection from one URL to another. It’s crucial when changing domains to guide visitors and search engines to the new address, preserving SEO rankings and maintaining user experience. Configure redirects in your hosting or through a plugin.
How do I ensure my SSL certificate works with the new domain?
To ensure your SSL certificate works with the new domain, reissue or purchase a new SSL certificate for the updated domain. Update the certificate in your hosting provider’s control panel and ensure all HTTPS settings are correctly configured in WordPress.
Can I change my domain without losing website traffic?
Yes, you can change your domain without losing website traffic by setting up proper 301 redirects, updating all internal links, and ensuring your new domain is properly configured in DNS settings and WordPress. Regularly monitor traffic to ensure a smooth transition.
How do I update my DNS settings for the new domain?
Updating your DNS settings involves logging into your domain registrar’s dashboard and changing the DNS records to point to your new domain. Update the A records, CNAME records, and ensure the name servers reflect your new domain’s hosting provider.
What should I do if my new domain is not resolving?
If your new domain is not resolving, check your DNS settings for accuracy, ensure your name servers are correct, and wait for DNS propagation, which can take up to 48 hours. Clear your browser cache and test with different devices.
How do I update internal links and images after changing the domain?
Use a plugin like Better Search Replace to update internal links and images. Manually check your website content to ensure all URLs reflect the new domain. Update permalinks and resave settings in the WordPress dashboard to fix broken links.
Is it necessary to inform my users about the domain change?
Yes, inform your users about the domain change to maintain trust and ensure they can access your content. Update your email marketing materials, notify subscribers, and announce the change on social media. Clear communication helps maintain user engagement.
Conclusion
Changing a domain name on WordPress can seem daunting, but with the right steps, it’s a smooth transition. Understanding how to change a domain name on WordPress involves updating your WordPress URL, configuring DNS settings, and ensuring proper 301 redirects.
By now, you should feel confident about the process. You’ve learned to back up your site, update your WordPress settings, and secure your site with an updated SSL certificate. Each step, from updating internal links to ensuring your SEO remains intact, is crucial for maintaining your site’s performance and visibility.
Remember, clear communication with your audience about the change, along with meticulous attention to detail, ensures a seamless transition. Follow these guidelines to preserve your website traffic and keep your brand strong.
If you enjoyed reading this article on how to change the domain name on WordPress, you should check out this one about how to hide the author in WordPress.
We also wrote about a few related subjects like creating a comparison table with WordPress plugins, how to scan the WordPress database for malware, how to upload an HTML file in WordPress, where are WordPress pages stored, and how to delete WordPress themes.