website · seo · redirects
How to migrate a website without losing search traffic
A step-by-step plan for redesigns, replatforms and domain moves: build a URL inventory, map old to new, generate 301 redirects, and monitor rankings after launch.
Updated · first published · 5 min read
Key points
- Traffic is lost when old URLs stop working, not when the design changes. Every URL that has traffic or links needs a one-hop 301 to its closest new equivalent.
- Build the URL inventory from several sources: the old sitemap, a crawl, Search Console's top pages and your backlink list.
- Never redirect everything to the home page; search engines treat that like a missing page.
- Keep redirects in place for at least a year, and update internal links so they point straight at the new URLs.
- For domain changes, use the Change of Address tool in Google Search Console and the Site Move tool in Bing Webmaster Tools.
Search engines don't rank websites; they rank URLs. When a site is rebuilt, moved to a new platform or a new domain, every old URL is a ranking, a bookmark and a link from someone else's page. If that URL stops answering, all three are gone.
That is why the work in a website migration is mostly bookkeeping: knowing every URL that matters, deciding where each one goes, and making the server say so. This guide covers that bookkeeping in the order you should do it.
1. Build the URL inventory
You can't redirect URLs you don't know about. No single source lists them all, so combine several:
- The old XML sitemap. The fastest starting point. Paste it into the sitemap URL extractor to get a plain list, including every child sitemap in a sitemap index.
- A crawl of the live site. Sitemaps are often incomplete or out of date. A crawler finds pages that are linked but not listed.
- Search Console's Performance report. Export the top pages by clicks for the last 12 to 16 months. These are the URLs where a mistake costs real traffic.
- Your analytics landing pages — they catch URLs with traffic from social, email and referrals.
- Your backlink list. Pages that other sites link to carry authority even if they get few visits. Old campaign pages and deleted posts often appear here and nowhere else.
Merge the lists and remove duplicates. Normalise them as you go: decide whether /page and /page/ are the same URL, and note any URLs whose query strings matter (?id=42 on older platforms often identifies a product).
2. Map old URLs to new ones
Each old URL needs a destination: the page on the new site that best answers the same question. The rules are simple to state:
- Same content, new address: redirect to the new address.
- Content merged into another page: redirect to the page that absorbed it.
- Content retired with a close substitute: redirect to the substitute — a discontinued product to its successor or its category.
- Content retired with nothing relevant: let it return 404 or 410. That is a legitimate answer.
What you shouldn't do is send everything without an obvious match to the home page. Google treats an irrelevant redirect like a missing page (a "soft 404"), so you get the drawbacks of both: no ranking transferred, and a confusing experience for the visitor.
For hundreds or thousands of URLs, the URL mapping tool does the first pass: it pairs old and new URLs by slug similarity and path structure, scores each match, and leaves you to review the uncertain ones. Spend your time on the pages from your Search Console export; that's where the traffic is.
3. Generate the redirects
Use permanent redirects: 301 (or 308, which also preserves the request method). Temporary redirects (302, 307) tell search engines to keep the old URL indexed, which is the opposite of what a migration wants.
Two rules keep redirects healthy:
- One hop. If
/aalready redirects to/bfrom a previous migration, and/bnow moves to/c, point/astraight at/c. Chains slow pages down and Googlebot only follows a limited number of hops. - No loops, no duplicates. A map with thousands of rows will contain both. Check for them mechanically.
The redirect generator takes the finished map and writes rules for Apache, nginx, Netlify, Vercel, Cloudflare and others, flattening chains and removing duplicates on the way. If you are also moving from Apache to nginx, the .htaccess to nginx converter translates the existing rewrite rules so the old behaviour carries over. For very large maps on nginx, a map block is more efficient than thousands of individual location or rewrite lines.
4. Before launch: the details that get forgotten
- Remove staging blocks. A
Disallow: /in robots.txt or anoindexmeta tag copied from staging to production is the most common cause of a post-launch collapse. Check both on launch day. - Update internal links. Redirects are for visitors and links you don't control. Your own navigation, content links, canonical tags and hreflang annotations should point straight at the new URLs.
- Rewrite hard-coded URLs in the database. On WordPress, a domain change means replacing the old URL throughout the database — carefully, because some values are PHP-serialised and break if a string's length changes. The WordPress search-replace tool rewrites a SQL dump while keeping serialised lengths correct.
- Generate a new sitemap listing only the new, canonical URLs, with the XML sitemap generator if your platform doesn't produce one.
- Keep the content stable. Changing URLs, templates and copy at the same time makes it hard to tell what caused a drop. If you can, migrate first and redesign second.
5. Launch and verify
Once the redirects are live, test them — don't assume. Take a sample of old URLs, weighted toward your highest-traffic pages, and request each one. Every request should return a single 301 to the expected destination, and that destination should return 200.
Then tell the search engines:
- Submit the new sitemap in Google Search Console and Bing Webmaster Tools.
- For a domain change, use Google's Change of Address tool and Bing's Site Move tool. Both require the redirects to be in place first.
- Keep the old domain registered and the redirects running. Google's guidance is to keep them for at least a year; in practice, keep them as long as anyone links to the old URLs.
6. Watch the right numbers
Some fluctuation in the first weeks is normal while search engines recrawl and reprocess the site. What you're watching for is a pattern:
- 404s in Search Console for URLs you meant to redirect — add them to the map.
- Pages that lost rankings individually — compare the old and new versions for missing content, changed titles or broken internal links.
- Crawl stats — a spike is expected; persistent errors are not.
Compare clicks and impressions per page against the same period before launch, not just site-wide totals. A site-wide number can hide a section that disappeared.
The short version
Inventory every URL that matters, map each to its closest new equivalent, redirect with one-hop 301s, fix internal links, and verify after launch. A website migration loses traffic when it skips the boring steps.
About the author
Abdessamad Bettal, full-stack engineer and the developer of migration.tools — free, private, browser-based tools for moving databases, data, websites and content between systems.