---
title: "WordPress to Astro: How to Migrate Without Losing SEO"
description: "How to move a WordPress site to Astro: headless or a full move, exporting posts and Yoast metadata, matching permalinks and redirecting WordPress URLs."
url: "https://dardo.studio/en/blog/wordpress-to-astro/"
language: "en"
translations: {"es":"https://dardo.studio/es/blog/migrar-de-wordpress-a-astro/","fr":"https://dardo.studio/fr/blog/migrer-wordpress-vers-astro/","de":"https://dardo.studio/de/blog/wordpress-zu-astro-migrieren/","it":"https://dardo.studio/it/blog/migrare-da-wordpress-ad-astro/","pt":"https://dardo.studio/pt/blog/migrar-de-wordpress-para-astro/","nl":"https://dardo.studio/nl/blog/wordpress-naar-astro/","sv":"https://dardo.studio/sv/blogg/migrera-wordpress-till-astro/","pl":"https://dardo.studio/pl/blog/migracja-z-wordpressa-do-astro/","uk":"https://dardo.studio/uk/blog/wordpress-to-astro/","ru":"https://dardo.studio/ru/blog/wordpress-to-astro/","ar":"https://dardo.studio/ar/blog/wordpress-to-astro/","hi":"https://dardo.studio/hi/blog/wordpress-to-astro/","th":"https://dardo.studio/th/blog/wordpress-to-astro/","ja":"https://dardo.studio/ja/blog/wordpress-to-astro/","ko":"https://dardo.studio/ko/blog/wordpress-to-astro/","zh-Hans":"https://dardo.studio/zh-Hans/blog/wordpress-to-astro/","zh-Hant":"https://dardo.studio/zh-Hant/blog/wordpress-to-astro/"}
updated: "2026-10-13T02:35:53.275Z"
---

[Blog](https://dardo.studio/en/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](https://dardo.studio/en/studio/) ·October 12, 2026

![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.](https://dardo.studio/_astro/01M4SH202BB16HWS7MBCWHNP1S_Z2cx2K1.webp)

## Key takeaways

- You can keep WordPress as a headless CMS behind Astro or move the content out entirely; the SEO work of keeping URLs and metadata is the same either way.
- Tools, Export gives you a WXR file with posts, pages, comments, custom fields and taxonomies; images stay in wp-content/uploads and have to be copied separately.
- With Yoast SEO, the REST API returns each page's final title, description, canonical and Open Graph tags in yoast\_head\_json, ready to reuse.
- WordPress permalinks end with a slash, like Astro's default output; reproduce date-based paths with dynamic routes instead of redirecting them.
- Redirect the URLs WordPress generates on its own too: feeds, ?p= shortlinks, attachment pages, author archives and any uploads you moved.

## The short answer

WordPress runs 40.1% of all websites, according to [W3Techs](https://w3techs.com/technologies/details/cm-wordpress) on 13 October 2026, so most site migrations start there. Astro's own [migration guide](https://docs.astro.build/en/guides/migrate-to-astro/from-wordpress/) 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 CMS                                                       | Move the content out of WordPress                                  |
| --------------------- | -------------------------------------------------------------------------------------- | ------------------------------------------------------------------ |
| Editing               | The same WordPress dashboard                                                           | A new CMS, or Markdown files in the repository                     |
| What Astro reads      | The WordPress REST API or WPGraphQL                                                    | Content collections or the new CMS's API                           |
| WordPress to maintain | Yes: hosting, updates and security patches, though it no longer has to face the public | None                                                               |
| Plugins               | Editing plugins keep working; anything that ran in the theme has to be rebuilt         | Everything you still need is rebuilt or replaced                   |
| Best when             | A large editorial team is happy in WordPress                                           | The site changes rarely, or the team is moving to a new CMS anyway |

Astro documents both: [using WordPress as a headless CMS](https://docs.astro.build/en/guides/cms/wordpress/) and [moving from WordPress](https://docs.astro.build/en/guides/migrate-to-astro/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 yoast_head_json 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](https://developer.yoast.com/customization/apis/rest-api/)). 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](https://make.wordpress.org/core/2020/07/22/new-xml-sitemaps-functionality-in-wordpress-5-5/)). 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](https://wordpress.org/documentation/article/tools-export-screen/)). For a scripted export, the [REST API](https://developer.wordpress.org/rest-api/reference/posts/) 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](https://docs.astro.build/en/guides/images/) 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 yoast_head_json 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](https://docs.astro.build/en/guides/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](https://pagefind.app/), 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](https://docs.astro.build/en/guides/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](https://docs.astro.build/en/reference/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](https://dardo.studio/en/blog/website-migration-seo-checklist/) covers launch day and the 90 days after it.

## What changes after the move

| Area        | On WordPress                                   | On Astro                                                        |
| ----------- | ---------------------------------------------- | --------------------------------------------------------------- |
| Editing     | WordPress dashboard and block editor           | WordPress as headless CMS, another CMS, or Markdown             |
| Hosting     | A PHP server and database                      | Any static host or edge platform, such as Cloudflare            |
| Updates     | Core, theme and plugin updates to keep up with | Dependency updates in the repository, none on the public server |
| Forms       | A form plugin                                  | Your own endpoint and storage                                   |
| Search      | WordPress search or a search plugin            | A static index or a search service                              |
| Performance | Caching and optimization plugins               | Pages built ahead of time, JavaScript only where you add it     |

## Keeping SEO intact

Google's guidance on [site moves with URL changes](https://developers.google.com/search/docs/crawling-indexing/site-move-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](https://dardo.studio/en/services/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](https://dardo.studio/en/services/web-development/) in Astro. If you're still deciding whether to leave WordPress at all, our comparison of [WordPress and a custom website](https://dardo.studio/en/blog/wordpress-vs-custom-website/) covers when each one pays off, and our guides to [Framer](https://dardo.studio/en/blog/framer-to-astro/) and [Webflow](https://dardo.studio/en/blog/webflow-to-astro/) migrations cover the other common starting points.

If you're weighing a move, [send us the site and what you want to change](https://dardo.studio/en/contact/?service=website-migration). 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.

- [W3Techs: Usage statistics and market share of WordPress](https://w3techs.com/technologies/details/cm-wordpress) · w3techs.com
- [Astro docs: Migrating from WordPress](https://docs.astro.build/en/guides/migrate-to-astro/from-wordpress/) · docs.astro.build
- [Astro docs: Headless WordPress & Astro](https://docs.astro.build/en/guides/cms/wordpress/) · docs.astro.build
- [WordPress documentation: Tools Export screen](https://wordpress.org/documentation/article/tools-export-screen/) · wordpress.org
- [WordPress REST API handbook: Posts](https://developer.wordpress.org/rest-api/reference/posts/) · developer.wordpress.org
- [Make WordPress Core: New XML sitemaps functionality in WordPress 5.5](https://make.wordpress.org/core/2020/07/22/new-xml-sitemaps-functionality-in-wordpress-5-5/) · make.wordpress.org
- [Yoast developer docs: REST API](https://developer.yoast.com/customization/apis/rest-api/) · developer.yoast.com
- [wordpress-export-to-markdown on GitHub](https://github.com/lonekorean/wordpress-export-to-markdown) · github.com
- [Astro docs: Content collections](https://docs.astro.build/en/guides/content-collections/) · docs.astro.build
- [Astro docs: Images](https://docs.astro.build/en/guides/images/) · docs.astro.build
- [Astro docs: Routing](https://docs.astro.build/en/guides/routing/) · docs.astro.build
- [Astro docs: Configuration reference](https://docs.astro.build/en/reference/configuration-reference/) · docs.astro.build
- [Pagefind: static search](https://pagefind.app/) · pagefind.app
- [Google Search Central: Site moves with URL changes](https://developers.google.com/search/docs/crawling-indexing/site-move-with-url-changes) · developers.google.com

[Nicolás Cerón](https://dardo.studio/en/studio/)

Nicolás Cerón is the founder of Dardo, a brand, web design and development studio in Bogotá, Colombia.

## Related articles

- [**WordPress or a custom website? How to choose, and when each one pays off**When WordPress is the right choice, when a custom site pays off, and the middle path of headless WordPress, compared on cost, speed, updates and ownership.](https://dardo.studio/en/blog/wordpress-vs-custom-website/)
- [**Webflow to Astro: how to migrate a Webflow site without losing content, design or rankings**Webflow's code export leaves out the CMS, forms, search and localized pages. What to take out of Webflow, what to rebuild in Astro and how to keep rankings.](https://dardo.studio/en/blog/webflow-to-astro/)
- [**Website migration SEO checklist: change platforms or domains without losing rankings**Rankings rarely drop because of the new platform; they drop because URLs that earned traffic stopped answering. A checklist from URL inventory to day 90.](https://dardo.studio/en/blog/website-migration-seo-checklist/)
- [**How much does a website cost in Colombia in 2026? Real prices and what moves a quote**Dated, published prices from Bogotá providers, the fixed yearly costs of a domain and hosting, and the factors that actually move a website quote.](https://dardo.studio/en/blog/website-cost-colombia/)

## Keep exploring.

- [Service · **Website migration without losing SEO**](https://dardo.studio/en/services/website-migration/)

- [Your project · **Start a conversation**](https://dardo.studio/en/contact/)
