Changing your domain name in WordPress doesn’t have to be stressful. This guide walks you through the entire process, from backing up your site to updating DNS settings, ensuring a smooth transition with zero downtime.
Changing your domain name in WordPress might sound like a technical challenge, but with the right steps, it’s completely manageable—even for beginners. Whether you’re rebranding, switching to a more memorable name, or moving from a .com to a .io, this guide will walk you through the entire process safely and efficiently.
In this comprehensive tutorial, you’ll learn how to change your domain name without breaking your site, losing SEO rankings, or confusing your visitors. We’ll cover everything from backing up your website to updating your database and setting up redirects. By the end, your WordPress site will be running smoothly on its new domain.
Key Takeaways
- Always back up your site first: Prevent data loss by creating a full backup before making any changes.
- Update WordPress Address and Site URL: Change these settings in the dashboard or wp-config.php to reflect your new domain.
- Use a search and replace tool: Safely update old domain references in your database with tools like Better Search Replace.
- Update DNS records: Point your domain’s nameservers or A record to your hosting server.
- Test thoroughly after the change: Check all pages, images, and links to ensure everything loads correctly.
- Set up 301 redirects: Preserve SEO rankings by redirecting old URLs to new ones.
- Monitor for broken links: Use tools or plugins to find and fix any issues post-migration.
Why Change Your Domain Name?
There are many good reasons to change your domain name. Maybe your current domain is too long, hard to spell, or doesn’t reflect your brand anymore. Perhaps you’re expanding into new markets and want a more region-specific extension like .uk or .ca. Or maybe you simply found a better, more available option.
Whatever your reason, changing your domain doesn’t mean starting from scratch. With proper planning, you can keep all your content, design, and search engine rankings intact.
Step 1: Back Up Your WordPress Site

Visual guide about How to Change Domain Name in WordPress
Image source: wphive.com
Before making any major changes, always back up your site. This includes your files and your database. If something goes wrong, you can restore everything quickly.
How to Back Up Your Files
You can use an FTP client like FileZilla to download all your WordPress files from your server. Connect to your hosting account, navigate to the public_html folder (or wherever your site is installed), and download everything to your computer.
How to Back Up Your Database
Your database contains all your posts, pages, comments, and settings. To back it up:
- Log in to your hosting control panel (like cPanel).
- Open phpMyAdmin.
- Select your WordPress database from the left sidebar.
- Click the “Export” tab and choose “Quick” export method.
- Click “Go” to download the .sql file.
Alternatively, use a plugin like UpdraftPlus or All-in-One WP Migration to automate backups.
Step 2: Purchase and Set Up Your New Domain
If you haven’t already, buy your new domain from a trusted registrar like Namecheap, GoDaddy, or Google Domains. Make sure it’s available and matches your brand.
Once purchased, you’ll need to connect it to your hosting. Most hosts allow you to add a new domain through your control panel. Some even offer free domain mapping.
Point Your Domain to Your Host
You have two main options:
- Change nameservers: Update your domain’s nameservers to point to your hosting provider (e.g., ns1.yourhost.com).
- Update the A record: Keep your current nameservers but change the A record to your server’s IP address.
Your hosting provider will give you the correct nameserver or IP details. This change can take 24–48 hours to fully propagate.
Step 3: Update WordPress Site URL and Home URL

Visual guide about How to Change Domain Name in WordPress
Image source: i0.wp.com
WordPress stores your site’s address in two places: the database and the settings. You need to update both.
Method 1: Update via WordPress Dashboard
If you can still access your WordPress admin:
- Go to Settings > General.
- Change both the WordPress Address (URL) and Site Address (URL) to your new domain (e.g., https://newdomain.com).
- Click Save Changes.
You might get logged out after this step. Just log in again using the new URL.
Method 2: Update via wp-config.php
If you can’t access the dashboard, edit your wp-config.php file:
- Use FTP or your file manager to open wp-config.php.
- Add these lines just above “That’s all, stop editing!”:
define('WP_HOME','https://newdomain.com'); define('WP_SITEURL','https://newdomain.com'); - Save and upload the file.
This method forces WordPress to use the new URLs.
Step 4: Update Domain References in the Database
Even after changing the site URLs, your database may still contain links, images, or content pointing to the old domain. You need to replace all instances of the old domain with the new one.
Use a Search and Replace Plugin
The safest way is to use a plugin like Better Search Replace:
- Install and activate the plugin from Plugins > Add New.
- Go to Tools > Better Search Replace.
- In “Search for,” enter your old domain (e.g., https://olddomain.com).
- In “Replace with,” enter your new domain (e.g., https://newdomain.com).
- Select all tables (or just wp_posts, wp_postmeta, and wp_options for safety).
- Check “Run as dry run” first to preview changes.
- If everything looks good, uncheck dry run and click “Run Search/Replace.”
Never edit the database directly unless you’re experienced—mistakes can break your site.
Step 5: Test Your Site on the New Domain
Once the changes are made, visit your new domain in a browser. Check:
- Homepage loads correctly
- All internal pages work
- Images and media display properly
- Menus and navigation function
- Forms and plugins operate as expected
If something looks broken, double-check your database replacements and file paths.
Step 6: Set Up 301 Redirects
To preserve your SEO rankings and help visitors find your content, set up 301 (permanent) redirects from your old domain to the new one.
Redirect via .htaccess (Apache Servers)
Edit your .htaccess file in the root directory and add:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^olddomain\.com [NC,OR]
RewriteCond %{HTTP_HOST} ^www\.olddomain\.com [NC]
RewriteRule ^(.*)$ https://newdomain.com/$1 [L,R=301,NC]
Replace olddomain.com and newdomain.com with your actual domains.
Use a Redirect Plugin
Plugins like Redirection or Simple 301 Redirects let you manage redirects from the WordPress dashboard without editing code.
Step 7: Update External Links and Notify Visitors
Let the world know about your new domain:
- Update your Google Search Console and Bing Webmaster Tools.
- Submit your new sitemap.
- Notify email subscribers and social media followers.
- Update business listings, ads, and email signatures.
This helps maintain traffic and trust.
Troubleshooting Common Issues
Even with careful planning, problems can arise. Here’s how to fix the most common ones.
White Screen of Death
If your site shows a blank page after the change:
- Check for syntax errors in wp-config.php or .htaccess.
- Disable plugins by renaming the plugins folder via FTP.
- Switch to a default theme like Twenty Twenty-Four by renaming your current theme folder.
For more on managing themes, see our guide on how to deactivate a theme in WordPress.
Images Not Loading
If images are broken, they may still be linked to the old domain. Re-run the search and replace tool, making sure to include http:// and https:// versions of your old URL.
Mixed Content Warnings
If your site uses HTTPS but some resources load over HTTP, you’ll see security warnings. Use the Really Simple SSL plugin to fix this automatically.
404 Errors on Pages
If pages return 404 errors, your permalinks may need refreshing. Go to Settings > Permalinks and click “Save Changes” to reset them.
For more on fixing broken links, check out our article on fixing broken links in WordPress without a plugin.
Final Tips for a Smooth Transition
- Schedule the change during low traffic: Minimize disruption by switching domains at night or on weekends.
- Keep the old domain active temporarily: Leave it pointing to your site for a few weeks to catch any missed redirects.
- Monitor Google Analytics: Watch for traffic drops or errors after the switch.
- Update your robots.txt file: Ensure search engines can crawl your new domain properly.
Conclusion
Changing your domain name in WordPress is a big step, but it doesn’t have to be scary. By following this guide—backing up your site, updating URLs, replacing database references, setting up redirects, and testing thoroughly—you can make the switch smoothly and safely.
Remember, the key to success is preparation. Take your time, double-check each step, and don’t hesitate to reach out to your hosting support if you get stuck. With your new domain live and working perfectly, you’ll be ready to grow your brand and reach even more visitors.
For related tasks, such as managing your site’s appearance, learn how to apply a WordPress theme to keep your design fresh and engaging.