Astro Themes & Starters

Migrating WordPress to Astro: Content Export, URL Mapping, and What Breaks

26 November 2026 · Updated 28 November 2026 · 15 min read · by Yang Kai

Migrate WordPress to Astro step by step: inventory, WXR export and Markdown conversion, SEO metadata, the redirect map that protects your traffic, launch checks, and fixes for what breaks.

Template inside: WordPress-to-Astro Migration Checklist + Redirect Mapping Table Template

Contents
  1. What you need before you start
  2. Step 1: Inventory before export
  3. Step 2: Back up, then set a content freeze
  4. Step 3: Export WordPress and convert to Markdown
  5. Step 4: Set up the Astro project and validate the content
  6. Step 5: Move the media — and keep the addresses that matter
  7. Step 6: Carry the SEO metadata over — deliberately
  8. Step 7: Build the URL map and the redirects
  9. Step 8: Replace what the plugins did
  10. Step 9: Rebuild the design — do not replicate it
  11. Step 10: Launch, then watch the URLs
  12. Troubleshooting: the failures that actually happen
  13. The migration checklist
  14. How we researched this
  15. What to do next

Most WordPress-to-Astro migrations that go wrong do not fail at the rebuild. They fail at the edges: a category of URLs nobody redirected, SEO titles that lived in a plugin and never made the trip, images still pointing at a WordPress install that no longer exists.

This guide is the full sequence, in the order that prevents those failures: inventory, backup, export and conversion, metadata, media, the redirect map, feature replacements, staging checks, and launch. It assumes you have already decided Astro is the destination — if you have not, the content-site comparison with Next.js covers that decision first.

The short version: export the content to Markdown, rebuild the design as an Astro theme, and map every old URL to a new one. The URLs are where your search traffic and other people’s links live, which is why the map gets its own step before any design work.

What you need before you start

Step 1: Inventory before export

Exporting first and asking questions later is the classic mistake. Spend an hour inventorying what the WordPress site actually is:

You should now have: four lists — content counts, every URL, every plugin with a disposition, and a media estimate. Every later step works from these.

Step 2: Back up, then set a content freeze

Take the full backup first, while nothing is mid-change. Then pick the freeze: the moment after which nobody edits the WordPress site, so the export you convert is the export that launches.

Small sites can freeze for the whole migration. Active sites freeze at the end instead: migrate a first export, build everything, then run a short delta export of anything published since, just before launch. Either way, the freeze is a decision made now, in writing — migrations that skip it end up reconciling two moving versions of the truth.

You should now have: a restorable backup and a freeze date everyone publishing to the site knows about.

Step 3: Export WordPress and convert to Markdown

In the WordPress admin, go to Tools » Export, choose All content, and download the export file. WordPress calls this format WXR: one XML file holding posts, pages, custom post types, categories, tags, authors and comments.

Convert the WXR file with wordpress-export-to-markdown, the open-source converter that Astro’s official migration guide points to. Run it in the folder holding the export:

npx wordpress-export-to-markdown --input=export.xml --post-folders=false --save-images=all

It writes one Markdown file per post, with frontmatter you choose — ask for title, date, slug, excerpt, categories, tags and a cover-image field — and it downloads the images each post actually uses. Two settings decide whether the conversion is clean:

Expect a cleanup pass afterwards. Shortcodes become stray bracketed text. Page-builder content may export as dense HTML blobs. Posts written by five editors over eight years carry five eras of formatting. Budget for it honestly; this pass, not the tooling, is where large migrations spend their time.

Note: A second route exists for very large or frequently updated sites: pull content from the WordPress REST API (/wp-json/wp/v2/) with your own script. It gives you field-level control at the cost of writing the converter yourself. Most sites should take the WXR route.

You should now have: one Markdown file per post and page, images downloaded beside them, and a short list of files flagged for manual cleanup.

Step 4: Set up the Astro project and validate the content

Start from Astro’s blog template (npm create astro@latest -- --template blog), which arrives with a layout, RSS feed and sitemap already wired. Copy the converted posts and pages into collections under src/content/.

Define the schema in src/content.config.ts to match the frontmatter the converter wrote — title, date, slug, description, tags — so content collections validate every file at build time. This is the migration’s quiet superpower: a post with a broken date or a missing title fails the build with the filename attached, instead of shipping as a quietly broken page. Fix what the build reports; that list is your cleanup pass, made explicit.

You should now have: a building Astro project in which every migrated post renders, and a build that complains by name about anything malformed.

Step 5: Move the media — and keep the addresses that matter

The converter has already downloaded the images your posts use and rewritten their references. Two decisions remain:

Unused uploads — the other eight sizes of every image, the abandoned drafts — do not migrate. The inventory from Step 1 is what lets you abandon them consciously rather than by accident.

You should now have: every referenced image loading on the staging site, and a deliberate answer for externally linked image URLs.

Step 6: Carry the SEO metadata over — deliberately

Your WordPress titles and descriptions mostly do not live in the post content. They live in your SEO plugin’s fields, and the standard WXR export does not carry them. A migration that skips this step ships a new site with worse metadata than the old one — the exact regression the honest Astro SEO checklist exists to catch.

Pull the plugin’s title and description fields separately — through the plugin’s own export, a bulk-export tool, or a script against the database or REST API — into a simple table keyed by slug. Then merge that table into your Markdown frontmatter, slug by slug. While you are there, carry over anything else the plugin owned that you still want: canonical choices, noindex flags on thin pages, and social images.

You should now have: every migrated page carrying the same title and description it had on WordPress, verified by spot-checking your top pages against the old site.

Step 7: Build the URL map and the redirects

Astro’s file-based routing means you can usually keep URLs identical: a post at /my-post/ stays at /my-post/, because the slug from Step 3 names the route. Protect that default. Every URL that does change — a new /blog/ prefix, renamed categories, consolidated posts — needs a redirect from old to new.

Build this table before the rebuild finishes, one row per URL that changes:

Old URL New URL Action Notes
/2023/05/my-post/ /blog/my-post/ 301 redirect Date-based permalink structure removed
/category/news/ /topics/news/ 301 redirect Category base renamed
/old-promo-page/ / 301 redirect Campaign ended; send to home, not a 404
/spammy-guest-post/ — 410 / no redirect Deliberately retired content
/about-us/ /about/ 301 redirect Kept short URL as canonical

Rules of thumb: 301 for anything with a genuine successor page; redirect to the closest relevant page rather than dumping everything on the homepage; retire truly worthless pages without a redirect instead of pointing them somewhere irrelevant. And keep URLs that do not change exactly unchanged — trailing slashes included — because “nearly the same” is a different URL.

On Cloudflare, a _redirects file shipped with the static output handles the list, and bulk redirects cover very large maps; the mechanics are part of deploying and running Astro on Cloudflare.

You should now have: a completed map in which every URL from the Step 1 list is accounted for — unchanged, redirected, or deliberately retired.

Step 8: Replace what the plugins did

Static Astro has no WordPress runtime, so each plugin from the inventory needs its replacement in place before launch:

You should now have: every plugin from the inventory either rebuilt, replaced by a service, or retired in writing.

Step 9: Rebuild the design — do not replicate it

Resist pixel-matching the WordPress theme. Choose or build an Astro theme that is structurally right — the evaluation approach in choosing an Astro theme applies — and accept visual differences that do not affect readers.

Migration is also the one cheap moment to fix the old site’s accumulated debt: the mobile layout nobody liked, the hero image that cost a second of load time, the archive page structure that never matched how readers browse. Fix what readers feel. Leave the rest alone; a migration that also becomes a redesign is how timelines double.

You should now have: a staging site that looks like the new design, reads like the old site, and passes a human read-through of the top 20 pages by traffic.

Step 10: Launch, then watch the URLs

Launch is a sequence, not a moment:

  1. Final delta export if the site kept publishing after the first one (Step 2), converted and merged the same way.
  2. Deploy the new site with the redirects live at the same time. Redirects that arrive a week after launch protect nothing.
  3. Keep the old WordPress site reachable privately — a subdomain or hosts-file entry — for at least a month. It is your reference for every “did this page exist?” question.
  4. Watch Search Console coverage for two weeks. New 404s are redirect-map gaps; fix them as they appear. Spot-check your top old URLs by hand, including a few image URLs from Step 5.

You should now have: the new site live, every old URL resolving to its planned destination, and a two-week watch that turns surprises into small fixes.

Troubleshooting: the failures that actually happen

Posts are dated one day late (or early) after conversion. The converter ran in UTC while WordPress published in your local timezone. Re-run it with your site’s timezone set (Step 3), before you build anything on top of the wrong dates — date-based permalinks inherit the error.

Shortcode text like [gallery] appears in converted posts. Shortcodes are WordPress runtime instructions; no converter can execute them. Search the converted files for brackets, and replace each shortcode with its static equivalent — the gallery becomes the images, the embed becomes a link or an iframe.

The build fails on a handful of posts. Almost always frontmatter: a date in an unexpected format, a missing title, a category field shaped differently from the schema. The build error names the file. Fix the file, not the schema — loosening the schema to pass bad data re-creates the WordPress problem in a new stack.

Images 404 on the staging site. Two usual causes: references still pointing at absolute WordPress URLs (rewrite them to the local files), or externally addressed images that were never copied into public/ (Step 5). Check which kind before fixing.

A redirect loops or lands on the homepage. Loops come from redirecting a URL to itself under a different slash or casing — compare the map’s rows character by character. Homepage landings come from a catch-all rule placed above the specific ones; order matters, specific first.

The migration checklist

How we researched this

This guide is desk research, not a migration we performed for this article. The sequence follows Astro’s official migration guidance and the documented behaviour of the tools it names — the WordPress WXR export and wordpress-export-to-markdown, whose current release line and options were checked in November 2026 — cross-read against the failure reports that recur in migration write-ups: timezone-shifted dates, stranded plugin metadata, and redirect gaps. Where a step depends on your host or your plugin set, the guide says so rather than inventing a universal answer.

FAQ

Will I lose my Google rankings migrating to Astro? Rankings are at risk mainly through changed URLs without redirects and lost metadata — both preventable with the map and checklist above. Keep URLs identical or redirected, carry the metadata over, and the technical side of the migration is sound. No honest guide can guarantee rankings stay identical; anyone who promises that is guessing.

How long does a WordPress to Astro migration take? A small blog: days. A large, plugin-heavy site: weeks, mostly spent on content cleanup and the redirect map rather than code. The inventory step exists to tell you which one you have before you commit to a timeline.

Can I keep my WordPress comments? Not natively in a static build. You can embed a hosted commenting service, import discussion into it where it supports that, or close comments. Decide from how much genuine conversation the old comments contain.

Should I change my URLs to a cleaner structure during the migration? Only with a complete redirect map, and only where the improvement is real. Every changed URL is risk and work; spend changes on structures that are actually hurting you, and leave working URLs alone.

Do I have to give up WordPress as an editor? No — a headless setup keeps WordPress as the editing backend while Astro fetches from its REST API at build time. It keeps the dashboard your editors know, at the cost of still running and securing a WordPress install. This guide follows the full-export route because it removes that cost entirely, but for multi-editor sites the headless route is a legitimate answer.

What to do next

Do the inventory this week — it costs an hour and converts a vague intention into a sized project. Then build the redirect map while the old site is still live to check against. If the new site needs a starting theme, browse the theme directory with your feature list in hand, and plan the hosting with hosting a static site for free if budget is the constraint.

Not every WordPress site should become Astro, though — if the goal is simply to keep publishing without the maintenance, the free Ghost hosting routes may be the shorter path.

Category: Astro Themes & Starters · Tags: #astro #tutorial #checklist #content #wordpress

Next step: this article is part of Astro guides, which covers the full topic from first setup to advanced use.

Related guides