Migrate WordPress to New Domain Without SEO Loss
A no-nonsense sequence to move your WordPress site to a new domain with zero SEO damage — tackle serialized data, staging, absolute URLs, and redirects the right way.

If you need to migrate wordpress to new domain without watching your rankings fall off a cliff, the playbook isn’t “copy files and redirect.” It’s a sequence that protects serialized data, keeps old absolute URLs from page builders intact, and tells Google exactly what happened before the switch. Follow it, and you keep the authority you’ve already earned.
Pre‑Migration Checklist: What to Lock Down First
The takeaway: You’ll move a clone to a brand‑new staging environment, block search engines from it, and only lift the block after the final redirect map is live on the old domain. Skipping staging is the single fastest way to split your link equity.
- Create a complete backup. Download all files via SFTP and export the database as a
.sqldump. If you’re on a managed host, use its snapshot tool — you want a point‑in‑time copy of everything. - Set up a staging environment on the new domain. Point
staging.newdomain.com(or a temporary subdomain) to the new server and install WordPress there using the copied files and database. - Block search indexing on the staging site with via Settings → Reading → “Discourage search engines…” and a
robots.txtthat disallows everything. You’ll turn that off only after the real launch. - Map every old URL to its new equivalent. Use a crawler like Screaming Frog to export all live URLs from the old site; you’ll need this list to build 301 redirects and to verify the change of address later.
How to Migrate WordPress to a New Domain Without Breaking SEO
The takeaway: Run a serialization‑aware search‑replace on the database, update hard‑coded links in theme files, and run the whole stack on the staging domain before you touch DNS. This prevents the “white screen of death” and keeps your layouts intact.
# WP‑CLI command — run this on the staging server after importing the DB
wp search-replace '//olddomain.com' '//newdomain.com' --all-tables --precise --dry-run
# Remove --dry-run once you’ve verified the changes- Why
--precisematters. WordPress stores theme settings, widget instances, and page‑builder data as serialized PHP strings. A simpleUPDATEquery corrupts those strings. The--preciseflag deserializes the data, swaps the domain, and re‑serializes it correctly. - Page builders are the biggest time bomb. Elementor, Beaver Builder, and Divi often hard‑code absolute URLs (e.g.,
http://olddomain.com/wp-content/uploads/…) inside the serialized post‑meta. The same WP‑CLI command handles them, but you must run it against every table — plugins and builders can lodge data in their own custom tables. - Check your theme files manually. Open each template file (header.php, footer.php, etc.) and look for statically coded references to the old domain. Replace them by hand. Migration plugins won’t touch PHP files.
- Update
wp-config.phpto point to the new database credentials and URL constants:
define('WP_HOME','https://newdomain.com');
define('WP_SITEURL','https://newdomain.com');
If you’d rather not handle serialized data yourself, our WordPress migration service wraps the entire pipeline — staging, incremental search‑replace, and page‑builder cleanup — into one automated pass so you never touch the command line. Team that with the migration solution that pre‑validates URL lists and rewrites before the switch.
Redirects, Search Console, and the Change of Address
The takeaway: The 301 redirect map must exist on the old domain before you change DNS, and you must file the Change of Address in Google Search Console on the new property. Miss either and you’ll see a ranking dip that can last months.
1. Build the redirect map on the old server
Leave the old WordPress installation running. Add a redirect rule that catches every old URL and sends it to the new domain with the same path.
# .htaccess on the old domain
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?olddomain\.com$ [NC]
RewriteRule ^(.*)$ https://newdomain.com/$1 [R=301,L]Test with curl -I https://olddomain.com/some-page/ — you must see a 301 Moved Permanently pointing to the new URL. This tells crawlers “the content has moved forever,” which preserves the link equity.
2. Verify the new property in Google Search Console
Add newdomain.com as a separate property. Use the same verification method you used for the old domain — DNS TXT record is the most reliable. Do not remove the old property.
3. File the Change of Address
Inside the old Search Console property, go to Settings → Change of Address and select the verified new domain. This is the explicit signal that tells Google you’ve permanently moved. Combine it with an updated XML sitemap from the new domain.
4. Switch DNS and remove the staging noindex
Once the redirects are live and the Change of Address is filed, point your domain’s A record to the new server. Then immediately uncheck “Discourage search engines” on the now‑live site and submit the new sitemap through Search Console.
Post‑Migration Must‑Dos
- Audit internal links. After the move, crawl the new domain to spot any remaining
olddomain.comin<a href>tags — often hidden in widgets, footer credits, or hard‑coded navigation. - Update external services. CDN origin URL, Google Analytics property settings, social media profiles, and any marketing emails that link to the old domain.
- Keep the old redirects alive for a minimum of six months. Prematurely dropping the old domain breaks backlinks and undoes the authority transfer.
FAQ
Will I lose my SEO rankings if I change my WordPress domain?
Not if you handle it correctly. With a full 301 redirect map from every old URL to its new counterpart, plus a properly executed Google Search Console Change of Address, your rankings typically transfer within a few weeks. Cutting corners — no redirects, missing the staging step, or breaking serialized data — will cause a temporary or permanent drop.
What’s the safest way to handle serialized data during a domain migration?
Always use a tool that understands PHP serialization. WP‑CLI’s search-replace with the --precise flag, the Better Search Replace plugin, or Delicious Brains’ WP Migrate (in push/pull mode) will deserialize, replace the domain, and re‑serialize correctly. A vanilla SQL UPDATE or naive search‑and‑replace will corrupt widgets, theme mods, and page‑builder layouts.
How long does it take for Google to transfer ranking signals to the new domain?
That depends on how quickly Google re‑crawls your site, but you’ll typically see the bulk of the ranking signals move within a couple of weeks. Make sure the old domain’s 301 redirects stay in place for at least six months and that you submit a new XML sitemap from the new domain immediately after the switch.