# Changing WordPress domain name without losing your rankings

> Changing domain name touches the address stored in nearly every WordPress database table, the Search Console property, and every external link pointing at the old site. Without a precise method, some of the ranking value already earned gets lost needlessly.

- Source canonique : [https://allaux.fr/en/wordpress-woocommerce/migration/changement-nom-domaine](https://allaux.fr/en/wordpress-woocommerce/migration/changement-nom-domaine)
- Langue : EN
- Dernière mise à jour : 2026-09-30

## Direct answer

> Point siteurl and home in wp_options at the new domain, then rewrite the rest of the database with a serialisation-aware tool. Keep the old domain live and 301 it to the new one address by address, never to the home page alone. Finally submit the change of address in Search Console: without it, the index takes far longer to follow.

## Why the old domain doesn’t just disappear with a DNS change

Redirecting DNS to a new domain name isn’t enough: the old domain stays wrapped inside the WordPress database, embedded in serialised PHP data strings used for theme settings, widget configuration and certain plugin options. Serialised data prefixes every piece of text it holds with its exact character length. If you replace the old domain’s text with the new one through a plain SQL query, without recalculating that length, the declared value no longer matches the actual text: WordPress can no longer read the data back, and the affected setting resets or disappears, sometimes with no visible error for days.

That’s why the fix goes through a tool that recalculates these lengths on every replacement, such as the WP-CLI wp search-replace command, run on both the old domain (while it stays temporarily live) and the new one, rather than a direct text edit in the database.

On a WooCommerce shop, this also covers product and category URLs, whose structure needs to stay identical on the new domain so each redirect remains a direct match rather than a generic one. I also regenerate the sitemap.xml with the new URLs before submitting it to Search Console, and check that no menu or widget still hardcodes a link to the old domain.

## How I change domain name without losing rankings

1. **Replacing URLs on both sites** — I run wp search-replace on a copy of the site with the new domain, while keeping the old domain temporarily live so existing access isn’t cut off during the transition.
2. **Page-by-page 301 redirects** — I set up a 301 redirect from every old-domain URL to its exact equivalent on the new one, never a blanket redirect to the homepage, which dilutes ranking value instead of passing it on, and I avoid chains of multiple redirects that slow down indexing.
3. **Updating the Search Console property** — I add the new domain as a separate property in Search Console and submit its sitemap, without deleting the old property until the redirects are confirmed live.
4. **Reporting the address change** — Where the tool allows it, I use Search Console’s change-of-address feature, which explicitly tells Google how the old and new domains relate.
5. **Keeping the old domain live for several weeks** — I keep the old domain name registered and pointed at the redirects for several weeks at minimum, long enough for Google to crawl the new URLs and pass on the ranking value already earned.

## The point of no return: freeing the old domain too soon

> Deactivating or releasing the old domain name before the 301 redirects have had time to pass their signal on to Google (several weeks at minimum) cuts that transfer short: external links pointing at the old domain stop working, and the accumulated ranking value no longer carries over to the new one.

## Going further

- **Guide: migrating without losing your rankings** — The general method for preserving rankings during a migration, applicable beyond just a domain change. ([/guides/migrer-sans-perdre-referencement](/guides/migrer-sans-perdre-referencement))
- **Migrating hosting without downtime** — The same serialisation mechanism applies during a host change, with its own switch-over method. ([/wordpress-woocommerce/migration/hebergeur-sans-interruption](/wordpress-woocommerce/migration/hebergeur-sans-interruption))
- **Moving a WordPress site to HTTPS** — Another URL change that touches the same WordPress options and follows a similar correction logic. ([/wordpress-woocommerce/migration/https-contenu-mixte](/wordpress-woocommerce/migration/https-contenu-mixte))
- **Understanding PHP serialisation** — The full definition of the mechanism that makes a plain SQL replace dangerous. ([/glossaire/serialisation](/glossaire/serialisation))

## FAQ

### Can I just redirect the whole old domain to the new homepage?

That’s not what I recommend: a blanket redirect to the homepage dilutes ranking value instead of passing it on. Every old-domain URL needs to redirect to its exact equivalent on the new one.

### How long should I keep the old domain live?

Several weeks at minimum, long enough for Google to crawl the new URLs through the 301 redirects and pass on the ranking value already earned. Releasing it too soon cuts that transfer short.

### Will changing domain crash my traffic?

A temporary dip during the reindexing period is normal. With 301 redirects correctly set up page by page and the old domain kept live, the impact stays limited and eases off gradually.

### Should I create a new Search Console property or edit the existing one?

I create a separate property for the new domain and, where the tool allows it, use the change-of-address feature to explicitly tell Google how the two relate.

### What happens to external links pointing at my old domain?

As long as the old domain stays live with its 301 redirects, those links keep working and pass their value on to the new address. One more reason not to release the domain too quickly.
