Blog

WordPress to Astro: how to migrate a WordPress site, headless or all the way, without losing rankings

Two ways to move from WordPress to Astro, what to export, how to keep Yoast titles, permalinks and uploads, and the WordPress URLs most migrations forget.

By Nicolás Cerón ·

A sprawling old manor house at night with scaffolding and lit windows, and a crimson travelling trunk on a hand cart on the cobbled path that leads up to a small lit observatory on the hill.
On this page

The short answer

WordPress runs 40.1% of all websites, according to W3Techs on 13 October 2026, so most site migrations start there. Astro's own migration guide describes two routes: keep WordPress as a headless CMS and let Astro build the front end, or move the content out of WordPress entirely.

Either way, the work that protects your traffic is the same: keep every URL that earns visits, carry over the titles and descriptions your SEO plugin produced, copy the uploads folder, replace the plugins that did front-end work, and give every URL that changes a permanent redirect. Done in that order, the new site can load faster and cost less to run without starting its rankings from zero.

Headless WordPress or a full move?

Keep WordPress as a headless CMSMove the content out of WordPress
EditingThe same WordPress dashboardA new CMS, or Markdown files in the repository
What Astro readsThe WordPress REST API or WPGraphQLContent collections or the new CMS's API
WordPress to maintainYes: hosting, updates and security patches, though it no longer has to face the publicNone
PluginsEditing plugins keep working; anything that ran in the theme has to be rebuiltEverything you still need is rebuilt or replaced
Best whenA large editorial team is happy in WordPressThe site changes rarely, or the team is moving to a new CMS anyway

Astro documents both: using WordPress as a headless CMS and moving from WordPress, where it suggests the wordpress-export-to-markdown tool for the content.

What we saw in eight live WordPress sites

On 13 October 2026 we checked eight sites built on WordPress, from WordPress.org's own news blog to large publishers, to see what a migration can rely on:

  • Seven of the eight served their posts publicly through the REST API, at /wp-json/wp/v2/posts. The eighth answered 401: some hosts and security plugins lock the API down, so check yours before you plan around it.
  • Three of the eight also returned Yoast SEO's data with every post. Yoast adds a yoastheadjson field to the standard REST responses, with the title, description, canonical URL, Open Graph tags and schema it renders for that page (Yoast developer docs). That's the SEO metadata you need, ready to reuse.
  • Every post URL they returned ended with a trailing slash, and five of the seven included the year, as in /2026/10/post-name/. Astro has to reproduce that structure exactly, or every post needs a redirect.
  • Six of the eight still loaded jQuery, a reminder of how much front-end code a WordPress theme carries that an Astro rebuild can leave behind.

WordPress to Astro, step by step

  1. Inventory every URL. Since version 5.5, WordPress publishes a sitemap at /wp-sitemap.xml unless an SEO plugin replaces it with its own (Make WordPress Core). Add the Pages report from Google Search Console for the longest range available, note the permalink structure under Settings, Permalinks, and export the rules from any redirect plugin.
  2. Choose headless or a full move using the table above. The rest of the steps apply to both; with headless, "export" means reading the same data from the API at build time.
  3. Export the content. Tools, Export creates a WXR file, an XML export with your posts, pages, custom post types, comments, custom fields, categories, tags, custom taxonomies and users (WordPress documentation). For a scripted export, the REST API returns up to 100 posts per page, with the rendered HTML of each one.
  4. Copy the uploads. Images aren't inside the XML file: they live in wp-content/uploads, along with the resized copies WordPress made of each one. Keep the originals, let astro:assets generate the sizes, and decide whether the old image URLs stay the same or need redirects.
  5. Carry over the SEO metadata. If the site runs Yoast SEO, read yoastheadjson from the REST API for every post and page: it gives you the final title and description rather than the templates the plugin stores. Otherwise, pull them from the plugin's custom fields in the export.
  6. Rebuild the templates as Astro components. In a full move, turn posts and pages into content collections or a new CMS; with headless WordPress, fetch them from the API. Check the HTML of a few posts for shortcodes, embeds and page-builder markup, which often needs cleaning before it looks right outside the old theme.
  7. Replace the plugins that did front-end work. Forms need their own endpoint (a Cloudflare Worker, a form service or your CRM), search can become a static index such as Pagefind, and comments need a decision: keep them, move them to a service or close them. Caching plugins have nothing left to do once pages are built ahead of time.
  8. Match the URL structure. WordPress permalinks usually end with a slash, which matches Astro's default directory output. Date-based permalinks become dynamic routes such as /[year]/[month]/[slug]/ (Astro routing); category and tag archives need their own pages or a redirect.
  9. Redirect at the server, including the WordPress leftovers. A static Astro build without an adapter turns configured redirects into meta-refresh pages (Astro configuration reference), so set 1:1 301s where the site is hosted. Beyond changed posts, cover the URLs WordPress creates on its own: /feed/, ?p= shortlinks, attachment pages, author archives and any /wp-content/uploads/ file you moved.
  10. Launch, then watch. Switch DNS, keep the old WordPress install reachable only to you until the new site is verified, and follow Search Console's indexing reports for the next few weeks. Our website migration SEO checklist covers launch day and the 90 days after it.

What changes after the move

AreaOn WordPressOn Astro
EditingWordPress dashboard and block editorWordPress as headless CMS, another CMS, or Markdown
HostingA PHP server and databaseAny static host or edge platform, such as Cloudflare
UpdatesCore, theme and plugin updates to keep up withDependency updates in the repository, none on the public server
FormsA form pluginYour own endpoint and storage
SearchWordPress search or a search pluginA static index or a search service
PerformanceCaching and optimization pluginsPages built ahead of time, JavaScript only where you add it

Keeping SEO intact

Google's guidance on site moves with URL changes applies: map every old URL to its closest new equivalent, use permanent server-side redirects and keep them for at least a year. WordPress makes identical URLs easier than most platforms, because its trailing-slash permalinks match Astro's defaults; the work is in reproducing date paths, archives and every URL a plugin generated.

Then check what the old theme and plugins were adding to every page: canonical tags, Open Graph images, structured data, the hreflang tags of a multilingual plugin and the robots rules. Anything missing on the new site is a signal Google loses on the day you switch.

How Dardo runs a WordPress migration

We run WordPress moves as part of our website migration service: URL and content inventory, the headless-or-full-move decision, a representative page rebuilt first and reviewed at agreed widths, then the rest of the templates, forms and redirects. The build itself is web development in Astro. If you're still deciding whether to leave WordPress at all, our comparison of WordPress and a custom website covers when each one pays off, and our guides to Framer and Webflow migrations cover the other common starting points.

If you're weighing a move, send us the site and what you want to change. We'll tell you whether headless or a full move fits before quoting either.

Common questions

Can I use WordPress with Astro?

Yes. WordPress can stay as a headless CMS: editors keep the WordPress dashboard and Astro builds the public site from the REST API or WPGraphQL. Astro documents this setup in its WordPress CMS guide.

How do I export WordPress content to Astro?

Use Tools, Export for a WXR file and convert it with a tool such as wordpress-export-to-markdown, or read posts from the REST API, up to 100 per request. Copy wp-content/uploads separately, because the images aren't inside the export file.

Will I lose my Google rankings moving from WordPress to Astro?

Not if every URL that earns traffic keeps working. Keep the permalink structure, including the trailing slash, carry over titles, descriptions and structured data, add 301 redirects for anything that changes, and watch Search Console for a few weeks after launch.

What happens to my WordPress plugins?

Plugins that help editors can keep working in a headless setup, but anything that ran in the theme, such as forms, sliders, search, comments or page builders, has to be rebuilt or replaced, because Astro renders the public pages itself.

Is Astro faster than WordPress?

An Astro site is built ahead of time and only ships JavaScript where you add it, so it doesn't need a PHP server or caching plugins to answer each visit. How much faster depends on what the WordPress theme loaded, so measure both before and after.

Sources & further reading

Sources behind this page, with further detail from the original publishers.