AstroWordPressMigrationStatic SiteTheme Development

Astro to WordPress: Convert Your Astro Site to a Theme the Easy Way

June 11, 20268 min readBy

Astro is built to ship static HTML. That makes it the easiest modern framework to move into WordPress. The output is already clean. You are not fighting a React runtime. But Astro still is not a WordPress theme, and the gap matters. Here is what transfers, what breaks, and the fastest way across.

Why Astro sites end up needing WordPress

Astro is a great fit for marketing sites, docs, and blogs. The people who own those sites after launch are usually not developers. That is where the friction starts.

  • Client content editing. Astro stores content in Markdown files and content collections. Editing means opening a code editor and committing to Git. Most clients want a dashboard. WordPress gives them one with no setup.
  • Plugin ecosystem. Forms, SEO tools, memberships, WooCommerce. These are WordPress-native. Bolting them onto an Astro site means writing or wiring each one yourself.
  • Hosting handoff. Many clients already run on a shared WordPress host. They do not want a Netlify or Vercel account and a build step they cannot read.
  • The design is done, the CMS is not. You shipped a polished Astro site, and the client now wants to edit it themselves. The design is solid. The platform is the problem.

Astro is closer to WordPress than React frameworks

This is the good news. Astro renders to HTML at build time and ships zero JavaScript by default. There is no client runtime hydrating your whole page. So the HTML in your dist folder is already standard, readable markup.

Compare that to a Next.js to WordPress move, where you have to deal with React hydration scripts, or a v0, Lovable or Bolt app that is a full single-page application. Astro starts you much closer to the finish line.

It still is not a theme, though. WordPress does not read a folder of HTML files. It builds each page from parts: a header, a footer, and template files in PHP. To use your design, that HTML has to be split into those parts and wired to WordPress functions.

Three approaches

Rebuild in WordPress manually

Recreate the Astro design as WordPress PHP templates. Write header.php, front-page.php, and functions.php by hand. Copy your CSS across and re-create each section.

Time: 8 to 20 hours. Less than a React rebuild because your .astro components are mostly HTML and scoped CSS already. But it is still a manual recreation, and you need to know WordPress theme structure to do it cleanly.

Astro build plus manual assembly

Run astro build. Astro writes static HTML, CSS, and any island scripts into a dist directory. Those files are your starting point.

From there you convert each page into a WordPress template: add wp_head() and wp_footer(), add body_class() and language_attributes(), structure a valid theme folder, and set up the template hierarchy. This is the same workflow you would use to convert any static site to WordPress.

Time: 3 to 8 hours. The HTML is clean, so most of the work is the PHP wiring, not fixing markup.

URL capture via StaticToWP

If your Astro site is deployed to a public URL, you can convert it in about 60 seconds. StaticToWP renders your live page in a real browser, captures the fully computed HTML and CSS, bundles every asset, and generates a complete WordPress theme zip.

Because Astro already ships static HTML, the capture is about as clean as it gets. There is no framework runtime to strip and no hydration mismatch to worry about. The same method works for Framer to WordPress and any other tool that publishes to a URL.

What the rendered Astro output looks like

Astro compiles your .astro components to HTML at build time. Scoped styles, the ones you write inside a <style> block in a component, compile to real CSS classes and ship in the page. Global styles ship as normal stylesheets.

The only JavaScript Astro adds is for islands: interactive widgets you opted into with a client: directive. Everything else is plain HTML. So the markup that reaches the browser, and the markup a capture sees, is the output you want.

Step-by-step: Astro to WordPress

  1. Deploy your Astro site to a public URL. Netlify, Vercel, Cloudflare Pages, or any static host works. If you only have it on localhost, push a preview build first.
  2. Paste the URL into StaticToWP. Go to StaticToWP and enter your Astro site URL. It loads the page in a headless browser and captures the rendered output.
  3. Download the theme zip. You get a wp-theme.zip with WordPress template files, your CSS bundled, and local assets included.
  4. Upload to WordPress. Go to Appearance → Themes → Add New → Upload Theme, upload the zip, and activate it.
  5. Set your homepage. In Settings → Reading, set the homepage to a static page and pick your front page.
  6. Check the result. Your Astro design should render in WordPress with layout, type, and styling intact.

What transfers and what does not

What transfers cleanly

  • Layout and typography. All CSS renders before capture. Spacing, sizes, colors, and line heights carry over exactly.
  • Scoped component styles. Astro scoped styles are standard CSS by the time the page loads. They transfer with no special handling.
  • Tailwind CSS. Astro and Tailwind are a common pair. It works the same as a standalone build. See the Tailwind to WordPress guide for the details.
  • Fonts. Google Fonts and self-hosted fonts carry over. Bundled font files get included in the theme assets.
  • CSS animations. Keyframes and transitions are pure CSS. They play in WordPress without any framework.
  • Responsive layouts. Media queries are standard CSS, so your breakpoints work unchanged.
  • Static images. Images bundled at build time are included in the theme. External image URLs stay as references.

What needs work after migration

  • Interactive islands. A React, Vue, Svelte, or Preact island added with client:load or client:visible renders its initial HTML, which transfers. The interactivity does not. Rebuild those widgets with small vanilla scripts or a WordPress plugin.
  • Content collections. Your Markdown and MDX posts are the design layer once rendered, but they are not WordPress posts. Export the Markdown and import it with a Markdown importer, or paste shorter content directly into the editor.
  • View transitions. Astro view transitions rely on its client router. WordPress loads full pages, so those animated page changes will not carry over. The pages still work, they just navigate normally.
  • Server endpoints. If you used Astro SSR with API endpoints, those do not exist in WordPress. Move forms to WPForms or Gravity Forms, and custom data to the WordPress REST API.
  • Image optimization. Astro's <Image> component optimizes at build time. In WordPress the images render as standard tags. Add an image optimization plugin and a cache plugin to recover the difference.

SEO when moving from Astro to WordPress

Astro sites usually have tidy SEO already. Carry that work over instead of starting fresh.

  • Match your URL structure. If Astro served /blog/post-slug, keep the same slugs in WordPress. Set permalinks to "Post name" under Settings → Permalinks.
  • Add 301 redirects. For any URL that changes, redirect the old path to the new one with the Redirection plugin.
  • Re-enter meta titles and descriptions. Your Astro tags are in the captured HTML as static strings. Install Yoast or Rank Math and re-enter them so WordPress manages them.
  • Submit your sitemap. WordPress generates one automatically. Submit it in Google Search Console and drop the old Astro sitemap.

FAQ

Is converting Astro to WordPress easier than converting React?

Yes. Astro ships static HTML with little or no JavaScript by default, so the output is already clean. A React app ships a runtime that hydrates the whole page. With Astro you skip that step, which is why a capture of an Astro page is so close to final.

Does this work with Astro SSR sites, not just static ones?

Yes. The capture happens in the browser after the page renders, so it does not matter whether Astro built the page ahead of time or rendered it on request. What reaches the browser is what gets captured.

What happens to my interactive React or Svelte islands?

The initial HTML of each island transfers and looks correct. The behavior does not. A counter, a tabbed panel, or a search box needs to be rebuilt with a small script or a plugin once the theme is in WordPress.

Can I move my Astro blog posts into WordPress too?

The conversion handles the design. For the posts themselves, export your Markdown or MDX and import it with a Markdown import plugin, then assign your WordPress post template. For a small blog, pasting posts into the editor is often faster than setting up an importer.

Will the WordPress theme load fast?

The theme bundles CSS into one file and serves scripts locally, with no render-blocking external dependencies. Add a cache plugin and a CDN and the result is comparable to a hand-built WordPress theme. You can read more in the HTML to WordPress theme guide.

Share this post

Founder, StaticToWP

Tom built StaticToWP after spending years converting static HTML and AI-generated designs to WordPress by hand. He got tired of doing it manually on every project, so he automated the process. He has converted hundreds of sites across Webflow, Lovable, v0, and plain HTML.

More about Tom

Stay in the loop

New guides, straight to your inbox.

No spam. Useful stuff only. Unsubscribe any time.

Ready to skip the manual work?

Paste any live URL — Webflow, Lovable, v0, Bolt, plain HTML — and get a production WordPress theme in under a minute.

Try StaticToWP free

Free to convert · Free during beta