Astro site deployed. WordPress gone. Google Search Console still returning the old WordPress URLs as the indexed pages. New content: not indexed.
Four steps fixed it.
Step 1: Register in Google Search Console
The old WordPress install had its own Search Console property. The new Astro domain needed a separate registration.
Path: Search Console > Add property > URL prefix > enter root domain.
Verification method used: HTML file upload. Placed the verification file in public/ — Astro serves it at the root path. Verified in under 5 minutes.
Step 2: Submit the New Sitemap
Astro doesn't generate a sitemap by default. Added @astrojs/sitemap to the integration list.
// astro.config.ts
import sitemap from '@astrojs/sitemap';
export default defineConfig({
site: 'https://yourdomain.com',
integrations: [sitemap()],
});
This generates /sitemap-index.xml and /sitemap-0.xml at build time.
In Search Console: Sitemaps > Add new sitemap > sitemap-index.xml. Submitted. Status moved from "Pending" to "Success" within 48 hours. Indexed URL count started climbing.
Step 3: 301 Redirects for Old WordPress URLs
WordPress URL structure (/YYYY/MM/DD/post-slug/) didn't match the new structure (/posts/slug). Old URLs were indexed. Without redirects, Google would keep serving them as 404s.
Redirects in astro.config.ts:
redirects: {
'/2024/11/15/old-post-slug': '/posts/new-post-slug',
// repeat per post
}
For sites with many posts, a redirect map file is cleaner. For the initial migration, explicit entries were sufficient.
Step 4: Request Re-Indexing
In Search Console, URL Inspection tool > enter each new URL > Request indexing. This queues the URL for Googlebot re-crawl outside the normal schedule.
Did this for the 10 highest-priority pages. Within 72 hours, those pages appeared in search results with the correct new URLs.
What Didn't Work
Waiting. Google does not automatically discover new URL structures. Without the sitemap submission and explicit re-index requests, the old WordPress URLs stayed indexed and the new pages stayed invisible.
The 301 redirects are permanent — they pass link equity from the old URLs to the new ones. That part takes weeks to fully propagate, but the user-facing search result switch happened within days.
