How to Change Your WordPress Domain (2026)
How to change your WordPress domain without losing SEO: back up, update the site URL, search-replace the database, set 301 redirects, and update Search Console.
Rebranding, buying a shorter domain, or finally dropping the hyphen you regretted — sooner or later you may need to change your WordPress domain. It is one of the few WordPress tasks where a careless step can cost you rankings, break every image on the site, or lock you out of the dashboard entirely. Done methodically, though, it is a predictable process that preserves your SEO and your sanity.
This guide walks through changing your WordPress domain from start to finish: backing up first, updating the site address, running a database search-replace so no old URLs are left behind, setting up 301 redirects, and telling Google about the move. We will also clear up a common point of confusion — the difference between changing your domain and simply changing your site URL or path.
Change Domain vs. Change Site URL: Know Which You Need
These two tasks get lumped together, but they are not the same, and the steps differ.
Changing your domain means moving from one hostname to another — oldsite.com to newbrand.com. The domain itself changes, which means DNS, redirects from the old domain, and a full database search-replace are all in play. This is the higher-stakes operation and the main focus of this guide.
Changing your site URL or path is a smaller move where the domain stays the same but the address WordPress uses changes. Common examples:
- Switching from
http://tohttps://after installing an SSL certificate - Consolidating
www.example.comandexample.comto one canonical version - Moving WordPress out of a subdirectory (
example.com/blog/) to the root (example.com/)
Both cases involve updating WordPress’s stored addresses and search-replacing old URLs, but changing the actual domain adds DNS changes and old-domain redirects on top. If your task is really just an HTTPS or www switch, you can skip the DNS and old-domain-redirect steps and focus on the site-address and database sections below.
Step 1: Back Up Everything First
Do not touch a single setting until you have a complete, tested backup. A domain change edits your database in bulk, and if a search-replace goes wrong, a backup is the only clean way back.
Capture both halves of your site — the database and the files (especially /wp-content/uploads/). A plugin like UpdraftPlus can do both in a couple of minutes and drop the archive on Google Drive or Dropbox. For the full walkthrough, see our guide on how to back up a WordPress site.
If your domain change is really part of a bigger move — new host as well as new domain — treat it as a migration and follow the end-to-end process in our guide to migrate a WordPress site. The steps below assume the site stays on the same server and only the domain changes.
Step 2: Point the New Domain’s DNS at Your Site
Before WordPress can answer to the new domain, the new domain has to resolve to your server.
- In your domain registrar or DNS host, edit the DNS records for the new domain.
- Point the
Arecord (and thewwwCNAME, if you use one) at the same IP address your current site uses. - If your host uses a control panel, add the new domain as an addon or alias domain, or set it as the primary domain, so the server knows to serve your WordPress install for it.
DNS changes can take anywhere from a few minutes to a couple of hours to propagate. Wait until the new domain loads your site (even if links still point to the old domain) before moving on. Keep the old domain active and pointed at the server for now — you will need it for redirects.
Step 3: Update the WordPress Address and Site Address
WordPress stores two URLs that tell it where it lives: WordPress Address (URL) and Site Address (URL). For most sites these are identical. There are two ways to change them.
Option A: Settings > General (the easy way)
In your dashboard, go to Settings → General and update both fields to the new domain:
- WordPress Address (URL) — where the WordPress core files live
- Site Address (URL) — the address visitors type to reach your site
Save, and WordPress will log you out because the address just changed. Log back in at the new domain. If both fields are greyed out, they are hard-coded in wp-config.php (see Option B).
Option B: wp-config.php (when the dashboard locks you out)
If changing the address in the dashboard breaks access — a real risk, since you can lock yourself out before the new domain fully works — set the values in wp-config.php instead. Add these lines above the /* That's all, stop editing! */ comment:
define( 'WP_HOME', 'https://newbrand.com' );
define( 'WP_SITEURL', 'https://newbrand.com' );
These constants override the database values and grey out the fields in Settings → General, so they are the safest option during a move. Once everything is stable, you can leave them in place permanently — many developers do, precisely because it prevents accidental URL changes.
Step 4: Search-Replace Old URLs in the Database
This is the step people skip, and the one that causes the most damage when they do. Updating the site address does not rewrite the thousands of old-domain URLs baked into your content: image src attributes, internal links inside posts, widget settings, and serialized data in theme and plugin options. Leave them and you get broken images, mixed links, and pages that quietly pull assets from a domain you are trying to retire.

You need a tool that safely handles serialized data — PHP-serialized strings store their own character lengths, so a blind find-and-replace with a raw SQL query will corrupt them. Use one of these instead.
Better Search Replace (plugin, beginner-friendly)
The free Better Search Replace plugin handles serialized data correctly and runs entirely from the dashboard.
- Install and activate Better Search Replace from Plugins → Add New.
- Go to Tools → Better Search Replace.
- In Search for, enter your old URL:
https://oldsite.com - In Replace with, enter the new URL:
https://newbrand.com - Select all database tables.
- Tick Run as dry run first. It reports how many changes it would make without touching anything.
- Review the count, then untick the dry run and run it for real.
Use the full URL including the protocol, not just the bare domain, so you do not accidentally rewrite unrelated text.
WP-CLI (fast and reliable for larger sites)
If you have shell access, WP-CLI is the cleanest option. Its search-replace command is serialization-aware by default:
# Preview the changes without writing anything
wp search-replace 'https://oldsite.com' 'https://newbrand.com' --dry-run
# Run it for real, skipping the GUID column (see below)
wp search-replace 'https://oldsite.com' 'https://newbrand.com' --skip-columns=guid
The --dry-run flag mirrors the plugin’s dry run. The --skip-columns=guid flag matters: the guid field in the posts table is a permanent identifier that feed readers use to tell posts apart, and the official guidance is to leave it unchanged even after a domain move. Everything else — post content, metadata, options — should be updated.
After the search-replace, spot-check a few posts, load pages with images, and confirm nothing still references the old domain.
Step 5: Set Up 301 Redirects From the Old Domain
Your old domain is still indexed by Google and linked to from around the web. To preserve those rankings and send visitors to the right place, permanently redirect every old-domain URL to its exact match on the new domain.
The cleanest approach is a domain-wide 301 redirect at the server level, so oldsite.com/any/path/ lands on newbrand.com/any/path/ in a single hop. On Apache, add this to the .htaccess file for the old domain:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?oldsite\.com$ [NC]
RewriteRule ^(.*)$ https://newbrand.com/$1 [R=301,L]
On Nginx, the equivalent lives in the old domain’s server block:
server {
server_name oldsite.com www.oldsite.com;
return 301 https://newbrand.com$request_uri;
}
The key detail is that path — $1 on Apache, $request_uri on Nginx — which preserves the rest of each URL so every page maps to its counterpart rather than dumping everyone on the homepage. A blanket redirect to the homepage is a well-known SEO mistake that erases the topical relevance Google assigned to each page.
Keep the old domain registered and these redirects live for at least a year — ideally indefinitely — so link equity keeps flowing. If your URL structure is also changing, or you cannot do a clean one-to-one map, build a redirect map and handle it carefully; our WordPress redirects guide covers 301s, redirect maps, and how to avoid chains and loops in depth.
Step 6: Tell Google About the Move
Redirects handle the mechanics; Search Console tells Google the move is intentional so it re-indexes the new domain faster.
- Add and verify the new domain as a property in Google Search Console. You cannot use the Change of Address tool until the new property is verified.
- Use the Change of Address tool. In the old domain’s property, open Settings → Change of address, select the new verified property, and submit. This is a formal signal that consolidates the old site’s history onto the new domain.
- Submit your new sitemap. In the new property, go to Sitemaps and submit
https://newbrand.com/sitemap.xml. Make sure your SEO plugin regenerated the sitemap with the new URLs — if you are unsure how sitemaps work in WordPress, see our guide to XML sitemaps in WordPress.
Do the same in Bing Webmaster Tools, which has its own Site Move tool. Then leave the old property in place — do not delete it — so you can watch the old URLs drop out of the index and the new ones climb in.
Step 7: Clean Up Everything Else That Knows Your Old Domain
The core move is done, but plenty of systems still reference the old domain. Work through this checklist so nothing gets left behind:
- Internal links — the database search-replace catches links inside post content, but double-check hard-coded links in your theme templates, custom HTML widgets, and any menu items entered as manual URLs.
- Analytics — update the site URL in Google Analytics (or your analytics of choice) so sessions are attributed correctly and you can see the transition cleanly.
- CDN — if you use Cloudflare or another CDN, update the origin, cache settings, and any page rules to the new domain, then purge the cache so old-domain assets are not served from cache.
- Email — update the “from” address for transactional and marketing email, plus any SPF/DKIM records, so mail from the new domain does not land in spam.
- Third-party integrations — reconnect anything keyed to your URL: payment gateways, social login, embedded forms, API callbacks, and email marketing tools.
- Canonical tags and duplicate content — confirm your canonical URLs now point to the new domain. Serving pages on both domains without a clean redirect creates duplicates; our guide on how to fix duplicate content in WordPress explains why URL consolidation matters and how to keep it tidy.
- Backlinks — for your most valuable inbound links, reach out and ask the linking site to update the URL. Redirects preserve most of the value, but a direct link to the new domain is stronger still.
How to Verify the Move Worked
Before you consider the job done, confirm the essentials:
- Load the new domain and click through key pages, posts, images, and forms.
- Open a browser network tab, request an old-domain URL, and confirm it returns a single
301to the correct new-domain URL — not a chain, and not a homepage dump. - Search your database (or crawl the site with a tool like Screaming Frog) for any lingering
oldsite.comreferences. - Check that HTTPS is clean on the new domain with no mixed-content warnings.
- Watch Search Console coverage over the following weeks to confirm new URLs get indexed and old ones fall away.
A small ranking wobble in the first days or weeks after a domain change is normal as Google reprocesses everything. Clean 301s and a submitted Change of Address are what bring rankings back — and usually all the way back — rather than leaving them stranded on a dead domain.
Conclusion
Changing your WordPress domain is not risky because it is complicated; it is risky when steps get skipped. Back up first, point DNS at your server, update the WordPress and Site Address, run a serialization-safe search-replace so no old URL survives, redirect the old domain with path-preserving 301s, and file a Change of Address in Search Console. Work through the cleanup checklist, verify with real requests, and your rebrand keeps every bit of SEO equity you spent years building. When you are ready for a fresh look to go with the new name, browse our free WordPress themes.
FAQ
Will changing my WordPress domain hurt my SEO?
Not if you do it correctly. The ranking risk comes from missing steps — no 301 redirects, no Change of Address, or old URLs left in the database. With path-preserving 301 redirects from the old domain and a verified Change of Address in Google Search Console, link equity transfers to the new domain and rankings typically recover fully. Expect a brief, normal fluctuation while Google reprocesses the move.
What is the difference between WordPress Address and Site Address?
The WordPress Address (URL) is where your WordPress core files are installed, and the Site Address (URL) is the address visitors type to reach your site. For most installs they are identical. They differ only when WordPress lives in a subdirectory but you want the site to load from the root domain. Both are set in Settings → General or defined in wp-config.php.
Do I need to search-replace the database when I change domains?
Yes. Updating the site address alone leaves thousands of old-domain URLs embedded in post content, image paths, and plugin settings, causing broken images and mixed links. Use a serialization-aware tool like the Better Search Replace plugin or WP-CLI’s search-replace command so PHP-serialized data is not corrupted in the process.
How long should I keep the old domain and its redirects?
Keep the old domain registered and its 301 redirects live for at least a year, and ideally indefinitely. Search engines and external links keep pointing at old URLs for a long time, and removing the redirects resurrects broken links and undoes the ranking consolidation you worked to preserve. Redirects are cheap to keep; broken links are expensive.
Can I change my WordPress domain without a plugin?
Yes. You can update the addresses in Settings → General or wp-config.php, run the database search-replace with WP-CLI on the command line, and add the 301 redirects directly in your server config. Plugins like Better Search Replace simply make the database step safer and friendlier for anyone who prefers not to use the command line.