How to Move a WordPress Site to Astro
Three ways to move from WordPress to Astro, from keeping WordPress as your editor to exporting everything to Markdown files.

In this guide
Moving from WordPress to Astro usually means a faster site and cheaper hosting. It also means giving up the WordPress dashboard, unless you choose one of the options below that keeps it. Here’s how to decide, and how to do it.
First, pick a route
There are three ways to make the move, from least to most change:
| Route | What changes | Best for |
|---|---|---|
| Keep WordPress as the editor | Astro displays your content, WordPress stores it | Teams who need the dashboard |
| Export to Markdown | Content becomes files, WordPress goes away | Blogs and personal sites |
| Rebuild from scratch | Everything is new | Small sites, or a fresh start |
There’s also a fourth option: EmDash, a CMS built on Astro that can import a WordPress site. See how to move from WordPress to EmDash.
Route 1: Keep WordPress as a headless CMS
WordPress has a built-in API that hands out your content as data. An Astro site can read that data and build pages from it. Your writers keep logging in to WordPress, and visitors see a fast Astro site.
This is the most technical route, because you write the code that fetches and displays the content. The Astro docs have a WordPress guide with the details.
Route 2: Export your content to Markdown
This is the route most personal sites take.
- In WordPress, go to Tools, then Export, and download your content as an XML file.
- Convert it to Markdown. The Astro docs recommend wordpress-export-to-markdown, a free tool that runs in your terminal. We haven’t run it ourselves, so follow its own instructions.
- Create a new Astro project from the blog template:
npm create astro@latest my-blog -- --template blog
- Copy your Markdown files into the project’s content folder, and check that each one has the fields the template expects, such as a title and date.
- Copy your images into the project and fix any image paths.
Large sites with complicated posts usually need some hand editing after the conversion.
Route 3: Rebuild from scratch
For a five-page business site, it’s often quicker to copy the text by hand into a new Astro project. Our free course takes you from an empty folder to a live site.
Keep your addresses
Whichever route you take, make a list of your page addresses first. Then either:
- Keep them exactly the same in Astro. A WordPress post at
/my-post/becomes a file atsrc/pages/my-post.astro, or a blog post with that slug. - Or set up redirects from the old addresses to the new ones. Each host has its own way to do this.
This is the step that protects your search rankings.
Go live
Deploy the Astro site to a new host, test it at its temporary address, and only then point your domain at it. We recommend Cloudflare Workers, and we compare the alternatives in the best hosting for Astro.
Keep your WordPress site running for a few weeks afterwards, in case you need to check something.
Frequently asked questions
Will I lose my search rankings?
Not if you keep the same page addresses, or redirect old ones to new ones. Make a list of your current addresses before you start.
Can non-technical people still edit the site after the move?
Only if you keep a CMS. Plain Astro means editing files. If editors need a dashboard, consider keeping WordPress as a headless CMS, or look at EmDash.
Stuck on a step?
Check the common errors guide, look up a word in the glossary, or ask in the official Astro Discord, where the support channels are friendly to beginners.