A WordPress to Astro migration means rebuilding your site's front end in Astro and deciding where the content lives afterwards: in WordPress as a headless CMS, in a different CMS such as Directus, Strapi or Keystatic, or as Markdown files in Git. Rankings survive the move when every old URL either stays the same or gets a permanent 301 redirect to its closest new page, and when titles, descriptions and structured data are carried across. The risk sits in skipped URLs and lost metadata, not in Astro itself.
This guide is for business owners planning a move and agencies running one for a client. If you want the whole move handled for you, our Astro website development service includes WordPress to Astro migration with a full URL map.
Choose where your content will live
The first decision is where your editors will write once WordPress no longer builds the pages. Astro's own guide to migrating from WordPress (opens in a new tab) describes keeping WordPress as your CMS, exporting posts to Markdown, or using a different CMS that Astro reads from.
| Route | Who edits | What you keep | Good fit |
|---|---|---|---|
| Keep WordPress headless | Your team in the same WordPress admin | All content, users, ACF fields, SEO plugin data | Teams who know WordPress and publish often |
| Move to Directus, Strapi or Keystatic | Your team in a new admin | Content, after import and clean-up | Businesses wanting a lighter CMS or to leave WordPress |
| Markdown in Git | Developers, or editors through a Git-based editor | Content as files in the code repository | Small sites, documentation, developer-led blogs |
Route 1: keep WordPress as a headless CMS
WordPress stays, typically moved to a subdomain such as cms.example.com, and Astro reads its content through the REST API. Nothing has to be exported, editors keep their workflow, and Yoast or Rank Math data can still be used. You still maintain WordPress, and anything the theme did on the front end has to be rebuilt in Astro. Our post on Astro with headless WordPress covers that setup in detail.
Route 2: move content to Directus, Strapi or Keystatic
Content is exported from WordPress into a new CMS that Astro reads from. This suits businesses leaving WordPress updates and plugins behind but still wanting an editing screen. Check licences and hosting before you choose: Directus moved to a new licence in 2026 that is free for organisations under USD 5 million in yearly revenue and under 50 employees, according to the Directus v12 licence announcement (opens in a new tab), and Strapi closed its Strapi Cloud free plan to new sign-ups on 1 July 2026, per the Strapi blog (opens in a new tab). Keystatic stores content as files in your repository, so it has no database to host. Our guide to Astro with Directus goes further.
Route 3: Markdown files in Git
Every post becomes a Markdown file in the site's code, and Astro's content collections load them at build time with the glob() loader. There is no CMS to host or update, and a static site is cheap to host. The cost is editing: someone has to be comfortable with Git, or you add a Git-based editor such as Keystatic on top. For a wider comparison of editors, see our guide to the best headless CMS for Astro.
Export and clean the content
Content leaves WordPress more easily than layouts do. The built-in Tools, Export screen creates a WXR file (an XML format) holding posts, pages, custom post types, comments, custom fields, categories, tags, custom taxonomies and users, as the WordPress export documentation (opens in a new tab) describes. It is a single XML file, so plan to copy the images and other media from the uploads folder as well.
What needs cleaning depends on how the site was built:
- Classic editor and Gutenberg posts convert to HTML or Markdown fairly cleanly.
- Shortcodes from plugins (galleries, buttons, tabs, forms) do nothing outside WordPress and must be replaced with Astro components or removed.
- Page builder pages built with Elementor, Divi or similar store layout data that does not convert. Plan to rebuild those pages as Astro templates.
- ACF fields and custom post types need a matching structure in the new CMS or in content collection schemas.
Build the URL map before anything else
The URL map is the most important document in the whole migration. It is a spreadsheet with one row per old URL, the new URL it becomes, and the action: keep, redirect or retire. Google's site move guidance (opens in a new tab) asks you to decide where each old URL redirects, and warns against sending many old URLs to one unrelated page such as the home page.
Collect old URLs from several places, because each one misses something:
- The XML sitemaps from Yoast, Rank Math or WordPress core.
- A crawl of the live site.
- Search Console's Performance report and your analytics, for pages that get visits.
- Existing redirects in your SEO plugin, redirect plugin or server config.
Do not forget category, tag, author, date archive and pagination URLs, attachment pages and feed URLs. The simplest migration keeps every important URL identical, including whether it ends with a slash. Astro's trailingSlash and build.format settings let you match WordPress's slash style, which avoids a whole class of redirects. On our own WooCommerce to Astro rebuild, matching the slash style was part of how all 20 key URLs stayed exactly the same.
Set up 301 redirects the right way
Every URL that changes needs a permanent, server-side redirect. Google's redirects documentation (opens in a new tab) recommends 301 or 308 redirects whenever possible and treats meta refresh and JavaScript redirects as fallbacks. Its site move guide says to keep redirects for as long as possible, and generally for at least one year.
This matters with Astro because of how it builds. Astro's redirects setting in the config uses a 301 status by default, but the Astro routing guide (opens in a new tab) explains that a static build outputs those redirects as HTML files with a meta refresh tag, where the status code is not used. Supported hosting adapters write the redirects into the host's own configuration file instead, which gives real server-side 301 responses. Check which one you are getting before launch.
Test the redirects with a script or crawler that follows every row of the URL map and reports the final status code. Look for chains (A to B to C), loops and anything ending in a 404. If you would rather not build and test every redirect yourself, our website migration team can run the redirect plan and the launch with you.
Keep titles, descriptions and schema
For every page in the URL map, carry over:
- The SEO title and meta description from Yoast or Rank Math.
- The canonical URL, now pointing at the new address.
- Open Graph and social images.
- Structured data, such as Article, Product, FAQ, LocalBusiness or Breadcrumb schema.
- Headings and internal links inside the content.
- Noindex settings for pages you deliberately kept out of search.
On route 1, Astro can read this data straight from Yoast's yoast_head_json or Rank Math's headless endpoint. On routes 2 and 3, export it into fields in the new CMS or the front matter of each Markdown file. Then compare old and new pages side by side, ideally with a crawler that pulls the title, description, canonical and H1 from both versions.
Images, forms and other moving parts
Images belong in the URL map too: old URLs under /wp-content/uploads/ may be indexed or linked from other sites, so keep that path or redirect it. Astro's image pipeline can then resize them and serve modern formats.
Forms need a new home, because WordPress form plugins rely on WordPress to receive submissions. Common replacements are Astro Actions (server functions that accept form data on pages rendered on demand), a form service, or your CRM's own form. Test every form end to end, including the email notification and any CRM entry.
Other items to list early: site search, comments, newsletter sign-ups, cookie consent, analytics and tag manager, and any member or shop areas. A WooCommerce store can keep its cart and checkout on WordPress; our post on a headless WooCommerce store with Astro explains why.
The migration checklist
The order below keeps the risky work early, when it is cheap to fix.
- Inventory and URL map
- Content route and export
- Build on staging
- Redirect and SEO tests
- Launch
- Search Console watch
| Stage | Check |
|---|---|
| Before the build | URL map complete, content route chosen, page builder pages listed for rebuild |
| On staging | Staging blocked from search, every template built, forms tested |
| Before launch | Redirects tested from the URL map, titles and schema compared, sitemap lists only new URLs |
| Launch day | DNS or host switched, HTTPS working, robots.txt allows crawling, analytics firing |
| First weeks | Page indexing, Sitemaps and Performance reports checked, 404s fixed |
Search Console checks after launch
The next few weeks show whether Google has accepted the move. Google's site move guide says a small to medium-sized site can take a few weeks for most pages to move, and tells you to expect temporary ranking changes that settle over time.
What to watch:
- Sitemaps report. Submit the new sitemap and confirm its URLs are being indexed.
- Page indexing report. Watch for unexpected rises in "Not found (404)" or "Page with redirect".
- Performance report. Compare clicks and impressions for top pages against the weeks before launch.
- URL Inspection. Spot-check that Google sees the new canonical.
- Change of Address tool. Only needed if you move to a new domain or subdomain.
Fix stray 404s by adding the missing redirects, rather than sending them to the home page. Our earlier post on why a redesign can lose traffic lists the common causes, and our technical SEO services cover post-launch checks.
What decides the timeline
There is no fair single number for how long a WordPress to Astro migration takes, because a small brochure site and a large publisher are different projects. These factors move it most.
| Factor | Why it adds time |
|---|---|
| Number of templates | Each distinct layout is a new Astro component |
| Page builder content | Pages must be rebuilt, not converted |
| Custom post types and ACF fields | Need a matching content model and import |
| Content route | Keeping WordPress avoids export; moving CMS adds import and clean-up |
| URLs that change | Every changed URL is a redirect to write and test |
| Forms, search and integrations | Each needs a replacement and testing |
| Multilingual content | Each language multiplies URLs, redirects and checks |
Where to start
Start by exporting your current URL list and deciding which of the three content routes suits your editors. Those two choices shape the rest of the plan. When you want help, our Astro website development team can audit your WordPress site, build the URL map and quote the migration in writing before any work starts.
Frequently asked questions
Will I lose Google rankings moving from WordPress to Astro?
Not if the move is planned. Keep URLs the same where possible, 301 redirect the rest to their closest new pages, and carry over titles, descriptions and schema. Google's own site move guide says to expect temporary ranking changes while it processes the move.
Can we keep WordPress and still move to Astro?
Yes. WordPress can stay as a headless CMS on a subdomain, with Astro building the public site from its REST API. Editors keep the admin they know and nothing needs exporting.
Do Elementor or Divi pages convert to Astro automatically?
No. Page builder layouts depend on the builder's own CSS and scripts, so those pages are rebuilt as Astro templates. The text and images can be reused.
Does Astro support 301 redirects?
Yes, through the redirects setting in the Astro config, which defaults to 301. On a static build without an adapter those become meta refresh pages, so use a supported hosting adapter or your host's redirect file to get real server-side 301 responses.
Sources
The facts in this article were checked against these pages, last reviewed 26 November 2026.
- Migrating from WordPress, Astro Docsdocs.astro.build/en/guides/migrate-to-astro/from-wordpress/
- Site moves with URL changes, Google Search Centraldevelopers.google.com/search/docs/crawling-indexing/site-move-with-url-changes
- Redirects and Google Search, Google Search Centraldevelopers.google.com/search/docs/crawling-indexing/301-redirects
- Routing and redirects, Astro Docsdocs.astro.build/en/guides/routing/
- Tools Export screen, WordPress.org documentationwordpress.org/documentation/article/tools-export-screen/
- Directus v12 licence change, Directusdirectus.com/resources/directus-v12-license-change
- We are removing the free plan from Strapi Cloud, Strapistrapi.io/blog/we-re-removing-the-free-plan-from-strapi-cloud




