Site migration SEO comes down to one rule: every URL that earns traffic today must either stay exactly the same or return a 301 redirect to its closest new equivalent, with its content, title and description intact. When you move to Astro from WordPress, Webflow, Wix or anything else, the platform change itself doesn’t hurt rankings. Lost URLs, changed content and missing metadata do.
This checklist covers the work before, during and after launch, with Astro code for the parts you’ll build. Use it alongside the platform-specific guides, such as WordPress to Astro or Webflow to Astro.
Key Takeaways
- Build a full URL inventory from the sitemap, Search Console and analytics before you write any code.
- Keep URLs identical where you can; redirect one-to-one with 301s where you can’t.
- Carry over titles, meta descriptions, headings, body content, structured data and internal links.
- Test every old URL against the new site before switching DNS.
- Monitor Search Console for at least eight weeks and keep redirects in place for a year or more.
Before the migration
1. Record a baseline
Export the last 3 to 12 months of data so you can compare after launch:
- Search Console: queries, pages, clicks and impressions (Performance report).
- Analytics: landing pages by organic sessions.
- Indexed page count and any existing errors from Search Console’s Pages report.
- Current rankings for your most important queries, if you track them.
2. Build the URL inventory
Combine every source of URLs into one spreadsheet: the XML sitemap, Search Console’s top pages, analytics landing pages, and a crawl of the live site with a crawler such as Screaming Frog. Old URLs that still get backlinks matter even if they aren’t in the sitemap.
For each URL record: current title, meta description, H1, canonical, status code, organic clicks, and the planned new URL.
3. Decide the new URL structure
The safest plan is no URL changes at all. Astro’s file-based routing can reproduce almost any structure: root-level posts (src/pages/[slug].astro), date paths with rest parameters, or legacy folders. The Astro routing guide covers each pattern.
If you do change structure, change it once, during the migration, and map every old URL to a specific new one.
4. Freeze content changes
Don’t rewrite pages during the migration. Keep body copy, headings and internal links the same so that, if traffic moves, you know the cause. Improve content after rankings settle.
During the build
5. Match the trailing slash convention
Pick one format and make config, internal links, canonicals and the sitemap agree:
// astro.config.mjs
import { defineConfig } from 'astro/config';
import sitemap from '@astrojs/sitemap';
export default defineConfig({
site: 'https://www.example.com',
trailingSlash: 'always', // or 'never' to match a platform like Webflow or Squarespace
integrations: [sitemap()],
});
If the old site used no trailing slash and you switch to always, every URL changes. Either match the old format or make sure your host 301s one form to the other. The trailing slash tip explains the setting.
6. Carry over every head tag
Build one SEO component and pass page-specific values from frontmatter. At minimum: title, meta description, canonical, Open Graph tags and robots directives. Keep titles and descriptions identical to the old site at launch.
---
// src/components/SEO.astro
interface Props {
title: string;
description: string;
noindex?: boolean;
}
const { title, description, noindex = false } = Astro.props;
const canonical = new URL(Astro.url.pathname, Astro.site);
---
<title>{title}</title>
<meta name="description" content={description} />
<link rel="canonical" href={canonical} />
<meta property="og:title" content={title} />
<meta property="og:description" content={description} />
<meta property="og:url" content={canonical} />
{noindex && <meta name="robots" content="noindex" />}
The full version is in the Astro SEO checklist.
7. Preserve structured data
If the old site output JSON-LD (Article, Product, LocalBusiness, FAQPage, BreadcrumbList), reproduce it. Plugins on the old platform often added it silently, so check a few pages with the Rich Results Test before you start.
8. Keep internal links and images
Internal links should point straight to final URLs, not through redirects. Keep image alt text, and if image URLs appear in image search traffic, consider keeping their paths or redirecting them too.
9. Write the redirect map
Redirects should be:
- 301 (permanent), not 302.
- One-to-one: each old page goes to its closest equivalent, not to the homepage.
- Single hop: no chains of A to B to C.
- Served by the host where possible, so the response is a real 301 status.
Astro’s redirects option works for a few routes. In a static build it writes small HTML pages that redirect with a meta refresh, and some adapters translate it into host rules. For large lists, a host redirect file is the better choice:
# public/_redirects (Netlify and Cloudflare Pages)
/2023/05/old-post-title/ /blog/old-post-title/ 301
/services.html /services/ 301
/category/news/* /blog/ 301
The Astro redirects tip compares both methods.
10. Keep staging out of the index
Staging deploys shouldn’t be indexed. Use a password-protected preview or send a noindex header on preview URLs. If you add noindex through the SEO component, drive it from an environment variable so it can’t leak into production:
---
// src/layouts/BaseLayout.astro
import SEO from '../components/SEO.astro';
const { title, description } = Astro.props;
const isProduction = import.meta.env.PUBLIC_ENV === 'production';
---
<html lang="en">
<head>
<SEO title={title} description={description} noindex={!isProduction} />
</head>
<body><slot /></body>
</html>
Forgetting to remove a staging noindex is one of the most common causes of a post-migration traffic drop.
Before switching DNS
11. Test every old URL
Run the full inventory against the new site (deployed to a preview URL) and check status codes:
// scripts/check-urls.mjs
import { readFileSync } from 'node:fs';
const NEW_ORIGIN = process.argv[2]; // e.g. https://preview.example.pages.dev
const urls = readFileSync('old-urls.txt', 'utf8').split('\n').filter(Boolean);
for (const old of urls) {
const path = new URL(old).pathname + new URL(old).search;
const res = await fetch(NEW_ORIGIN + path, { redirect: 'manual' });
const where = res.headers.get('location') ?? '';
if (res.status !== 200 && res.status !== 301 && res.status !== 308) {
console.log(`${res.status} ${path} ${where}`);
}
}
Run it with node scripts/check-urls.mjs https://your-preview-url. Anything printed is a 404, a 302 or an error to fix. Also confirm redirect targets return 200 rather than redirecting again.
12. Compare page by page
For the top 50 pages by traffic, compare old and new side by side: title, description, H1, body text, canonical and structured data. Catching a missing paragraph now is far cheaper than finding it in a traffic report.
13. Check robots.txt and the sitemap
Make sure robots.txt allows crawling and points to the new sitemap, and that the sitemap lists only final, 200-status URLs with the right trailing slash. The robots.txt tip has an Astro example.
After launch
14. Submit and monitor in Search Console
- Submit the new sitemap.
- If the domain changed, verify both properties and use the Change of Address tool.
- Use URL Inspection on key pages to request indexing.
- Watch the Pages report for new 404s and “Page with redirect” counts.
- Compare clicks and impressions against your baseline weekly.
Some fluctuation in the first few weeks is normal while Google recrawls. A drop limited to specific pages almost always points to a URL, content or metadata difference on those pages.
15. Fix stragglers and keep redirects
Check server or host logs and Search Console for 404s on URLs you missed, and add redirects for them. Keep redirects in place for at least a year, and longer for pages with backlinks. There’s little cost to keeping them indefinitely.
16. Update external references
Update links you control: social profiles, directory listings, email signatures, and any partner sites. Each one becomes a direct link instead of a redirect.
Moving to a new design at the same time? Starting from a finished Astro theme keeps the build short so you can spend the time on this checklist. Every one of our Astro themes ships static pages with editable head tags, and the getting started docs show how to run one locally.
FAQ
Will migrating to Astro hurt my SEO?
Not by itself. Rankings drop after migrations when URLs break, content changes, or metadata goes missing. Keep URLs the same or 301-redirected, carry over titles, descriptions and content, and Astro’s fast, crawlable HTML usually helps rather than hurts.
How long does it take to recover rankings after a migration?
With a clean migration, most sites see traffic settle within a few weeks as Google recrawls. Larger sites or migrations that change URL structure can take a few months. Persistent drops on specific pages usually mean something on those pages changed.
Should I use 301 or 302 redirects when migrating?
Use 301 (or 308) permanent redirects. They tell search engines the move is permanent and pass the old URL’s signals to the new one. Temporary 302 redirects can delay that transfer.
Can I redirect all old URLs to the homepage?
You shouldn’t. Search engines often treat mass redirects to the homepage as soft 404s, and visitors lose the page they wanted. Redirect each old URL to its closest matching new page.
How long should I keep redirects after a site migration?
At least a year, and indefinitely for pages with backlinks. Redirect rules are cheap to keep, and removing them turns old links back into 404s.