To migrate from Webflow to Astro, export your site’s code from Webflow for the HTML and CSS of static pages, export each CMS collection to CSV, turn the layouts into Astro components, and convert CSV rows into Markdown files in content collections. Then replace Webflow forms and interactions, match every URL, and switch DNS. A Webflow to Astro move suits teams who want to stop paying for site plans, own the code, and ship lighter pages.
Webflow’s code export is a useful head start, but it doesn’t include CMS content, and the exported markup is generated by the Designer rather than written for humans. This guide shows what to reuse, what to rebuild and how to keep your rankings.
Key Takeaways
- Webflow’s code export (on paid workspace plans) gives HTML, CSS, JavaScript and assets for static pages, not CMS items.
- CMS collections export to CSV from the CMS panel; a script turns each row into a Markdown file.
- Treat exported HTML as a reference. Rebuilding sections as Astro components gives cleaner, maintainable code.
- Webflow interactions run on
webflow.js; most can be replaced with CSS transitions or a small script.- Webflow URLs have no trailing slash. Match that in Astro config or redirect consistently.
Plan the move
Inventory the site before touching code:
| Webflow piece | Astro equivalent |
|---|---|
| Static pages | .astro pages in src/pages/ |
| Symbols / components | Astro components in src/components/ |
| CMS collections | Content collections (Markdown or a headless CMS) |
| Collection template pages | Dynamic routes with getStaticPaths() |
| Webflow forms | A form backend or an Astro Action |
| Interactions (IX2) | CSS animations, a small script, or a library island |
| Webflow Editor for clients | Markdown in Git, or a headless CMS |
| Webflow hosting | Cloudflare Pages, Netlify, Vercel or GitHub Pages |
Export your sitemap (/sitemap.xml on the live site) as the master list of URLs to preserve. If you’re still weighing the switch, the Astro vs Webflow comparison covers the trade-offs, especially for client editing.
Step 1: Export code and CMS data
Code export. In the Designer, use the export code option to download a zip with one HTML file per static page, the generated CSS (normalize.css, webflow.css and your site’s stylesheet), webflow.js and images.
CMS export. In the CMS panel, open each collection and export it to CSV. You’ll get one row per item with every field, including rich text as HTML and image fields as URLs on Webflow’s asset CDN.
For large sites, the Webflow Data API can fetch collection items as JSON instead, which is easier to automate and keeps reference fields as IDs.
Step 2: Create the Astro project and shared layout
npm create astro@latest my-site
cd my-site
npm install csv-parse turndown
Open an exported page and identify the shared parts: navbar, footer, and the <head> (fonts, meta tags). Move them into a layout:
---
// src/layouts/BaseLayout.astro
import Nav from '../components/Nav.astro';
import Footer from '../components/Footer.astro';
import '../styles/global.css';
interface Props {
title: string;
description: string;
}
const { title, description } = Astro.props;
---
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>{title}</title>
<meta name="description" content={description} />
<link rel="canonical" href={new URL(Astro.url.pathname, Astro.site)} />
</head>
<body>
<Nav />
<slot />
<Footer />
</body>
</html>
Step 3: Reuse or rebuild the styles
You have two choices for CSS:
- Reuse the export. Copy Webflow’s three stylesheets into
src/styles/and import them. Pages will look right immediately, but you inherit Webflow’s class naming (div-block-27, combo classes) and a large stylesheet. - Rebuild per component. Recreate each section as an Astro component with scoped styles or Tailwind CSS, using the export as a visual reference. More work up front, much easier to maintain.
A common middle path: reuse the export to launch quickly, then replace sections one at a time. The Astro styling docs cover scoped styles, global CSS and design tokens.
Step 4: Convert static pages
For each exported HTML file, create a page and paste the content between <body> and the scripts, minus the nav and footer:
---
// src/pages/about.astro
import BaseLayout from '../layouts/BaseLayout.astro';
import { Image } from 'astro:assets';
import team from '../assets/team.jpg';
---
<BaseLayout title="About us" description="Who we are and how we work.">
<section class="section about-hero">
<h1>About us</h1>
<p>We design and build products for climate startups.</p>
<Image src={team} alt="The team in our Lisbon studio" width={1200} />
</section>
</BaseLayout>
Swap <img> tags for Astro’s <Image /> with local files from src/assets/, so Astro handles resizing, modern formats and dimensions. Exported srcset attributes pointing at Webflow’s CDN should go.
Step 5: Turn CMS collections into content collections
Convert a CSV export into Markdown files. This example handles a blog collection; adjust column names to match your CSV header row:
// scripts/webflow-cms.mjs
import { readFileSync, writeFileSync, mkdirSync } from 'node:fs';
import { parse } from 'csv-parse/sync';
import TurndownService from 'turndown';
const turndown = new TurndownService({ headingStyle: 'atx' });
const rows = parse(readFileSync('webflow-export/blog-posts.csv'), { columns: true, skip_empty_lines: true });
mkdirSync('src/content/blog', { recursive: true });
for (const row of rows) {
if (row['Archived'] === 'true' || row['Draft'] === 'true') continue;
const fm = [
'---',
`title: ${JSON.stringify(row['Name'])}`,
`description: ${JSON.stringify(row['Summary'] ?? '')}`,
`pubDate: ${new Date(row['Published On'] || row['Created On']).toISOString()}`,
row['Main Image'] ? `image: ${JSON.stringify(row['Main Image'])}` : null,
'---',
].filter(Boolean).join('\n');
writeFileSync(`src/content/blog/${row['Slug']}.md`, `${fm}\n\n${turndown.turndown(row['Post Body'] ?? '')}\n`);
}
Define the matching collection in src/content.config.ts with a glob() loader and a Zod schema (import z from astro/zod). Then download images from Webflow’s CDN into your project before you cancel the plan, since asset URLs stop being reliable once the site is gone.
Collection template pages become dynamic routes. If Webflow served posts at /blog/post-slug, create src/pages/blog/[id].astro with getStaticPaths() returning one path per entry. The getStaticPaths guide explains the pattern.
Step 6: Replace forms and interactions
Forms. Webflow form submissions are handled by Webflow’s servers. On Astro, point the form at a form backend (Formspree, Netlify Forms, Basin) or handle it with an Astro Action on a server route. The static contact forms guide compares the options.
Interactions. Exported pages rely on webflow.js (and jQuery) for IX2 animations, dropdowns, tabs and sliders. Rather than ship that, rebuild them:
- Hover and scroll reveals: CSS transitions with an
IntersectionObserverscript. - Dropdown menus and tabs:
<details>elements or a few lines in an Astro<script>. - Sliders: a CSS scroll-snap carousel.
- Page transitions: Astro’s
<ClientRouter />or native CSS view transitions.
Each replacement removes JavaScript the visitor would otherwise download.
Step 7: Match URLs and redirect the rest
Webflow serves pages without a trailing slash (/about, /blog/my-post). Pick one format for Astro and make links, canonicals and the sitemap agree. To keep Webflow’s exact form, set trailingSlash: 'never':
// astro.config.mjs
import { defineConfig } from 'astro/config';
import sitemap from '@astrojs/sitemap';
export default defineConfig({
site: 'https://www.example.com',
trailingSlash: 'never',
integrations: [sitemap()],
redirects: {
'/old-services': '/services',
},
});
Static hosts differ in how they serve about/index.html for /about, so test on the real host. Copy any 301 rules from Webflow’s hosting settings into your host’s redirect file. The trailing slash tip explains the options.
Step 8: Launch
- Build, preview, and compare every page with the live Webflow site.
- Check that every URL from the old sitemap returns 200 or a 301.
- Deploy, connect the domain, and submit the new sitemap in Search Console.
- Keep the Webflow site plan active for a short overlap in case you missed assets.
If rebuilding the design from Webflow’s markup feels like the bulk of the work, starting from a finished Astro theme can be faster. Our Astro themes are plain Astro source with category-specific page sets, ready to receive your content.
FAQ
Can I export my Webflow site to Astro directly?
Not directly. Webflow’s code export gives you static HTML, CSS and JavaScript, which you convert into Astro pages and components. CMS content exports separately as CSV and becomes Markdown in content collections.
Does Webflow code export include CMS content?
No. Code export covers static pages and assets. Export each CMS collection to CSV from the CMS panel, or fetch items through the Webflow Data API, then convert them to Markdown or load them into a headless CMS.
Will I lose my rankings moving from Webflow to Astro?
Not if you keep the same URLs, titles, descriptions and content, and redirect anything that changes with a 301. Submit the new sitemap and watch Search Console for crawl errors in the first weeks.
How do I replace Webflow interactions in Astro?
Most interactions can be rebuilt with CSS transitions, IntersectionObserver scripts, <details> elements or a CSS scroll-snap carousel. That avoids shipping webflow.js and jQuery to every page.
How do clients edit content after leaving Webflow?
Connect a headless CMS such as Sanity, Storyblok, Keystatic or Decap, or let them edit Markdown files in Git. Astro rebuilds the site when content changes.