To migrate from Wix to Astro, start from your Wix sitemap to list every URL, rebuild the design as Astro pages and components, move blog posts into a Markdown content collection, download images from Wix’s media servers, and add 301 redirects wherever a URL changes. Wix has no code export, so this is a rebuild rather than a conversion, but the content itself moves over with a few scripts and some copying.
This Wix to Astro guide covers the inventory, content extraction, URL mapping and launch steps that keep your search traffic intact.
Key Takeaways
- Wix doesn’t export site code. You rebuild the design in Astro, by hand or from a theme.
- The sitemap at
/sitemap.xmllists every indexed URL; use it as your migration checklist.- Blog posts can be pulled from your own published pages or the blog’s RSS feed and converted to Markdown.
- Wix blog posts live at
/post/slug. Keep that path in Astro or redirect it.- Contacts and store products export as CSV from the Wix dashboard; move them to their new tools.
What you can and can’t take from Wix
| Wix content | How to move it |
|---|---|
| Page design and layout | Rebuild in Astro (no export) |
| Page text | Copy into .astro pages or Markdown |
| Blog posts | Extract from published pages or RSS, convert to Markdown |
| Images | Download from static.wixstatic.com |
| Contacts / subscribers | Export CSV from the dashboard |
| Store products | Export CSV, import into your commerce tool |
| Forms | Replace with a form backend |
| Bookings, members, chat | Replace with dedicated services |
| SEO titles and descriptions | Copy per page, or read from each page’s <head> |
If the site uses Wix Bookings, Members or Stores heavily, plan replacements first; the Astro vs Wix comparison covers what each of those means on Astro.
Step 1: Build the URL inventory
Wix publishes a sitemap index at /sitemap.xml that points to sub-sitemaps for pages, blog posts, categories and products. Pull every URL into one list:
// scripts/wix-urls.mjs
import { writeFileSync } from 'node:fs';
const SITE = 'https://www.example.com';
const locs = (xml) => [...xml.matchAll(/<loc>(.*?)<\/loc>/g)].map((m) => m[1]);
const index = await (await fetch(`${SITE}/sitemap.xml`)).text();
const urls = [];
for (const sub of locs(index)) {
urls.push(...locs(await (await fetch(sub)).text()));
}
writeFileSync('wix-urls.txt', urls.join('\n'));
console.log(`${urls.length} URLs saved`);
Open wix-urls.txt in a spreadsheet and add columns: new URL, status (keep, redirect, drop), and notes. This sheet drives the redirects later. Also export your top landing pages from Google Search Console so you know which URLs matter most.
Step 2: Create the Astro project
npm create astro@latest my-site
cd my-site
npm install cheerio turndown
Start with a base layout (head tags, header, footer), then rebuild page sections as components: hero, features, testimonials, gallery, contact. Use the live Wix site as the visual reference. If you’d rather not design from scratch, a finished theme gives you the components already; Komal Nakrani Astro themes by category cover the usual Wix site types, from restaurants and salons to studios and consultants.
Step 3: Extract blog posts
Since Wix doesn’t export posts, read them from your own published pages. Open one post in the browser, inspect the article body, and note a selector that wraps the content (Wix pages use data-hook attributes you can target). Then run:
// scripts/wix-posts.mjs
import { readFileSync, writeFileSync, mkdirSync } from 'node:fs';
import * as cheerio from 'cheerio';
import TurndownService from 'turndown';
const BODY_SELECTOR = 'article'; // set this from what you saw in dev tools
const turndown = new TurndownService({ headingStyle: 'atx' });
const posts = readFileSync('wix-urls.txt', 'utf8').split('\n').filter((u) => u.includes('/post/'));
mkdirSync('src/content/blog', { recursive: true });
for (const url of posts) {
const $ = cheerio.load(await (await fetch(url)).text());
const slug = new URL(url).pathname.split('/post/')[1].replace(/\/$/, '');
const title = $('meta[property="og:title"]').attr('content') ?? $('h1').first().text();
const description = $('meta[name="description"]').attr('content') ?? '';
const date = $('meta[property="article:published_time"]').attr('content') ?? new Date().toISOString();
const body = $(BODY_SELECTOR).first();
body.find('h1').first().remove();
const fm = ['---', `title: ${JSON.stringify(title.trim())}`, `description: ${JSON.stringify(description)}`, `pubDate: ${date}`, '---'].join('\n');
writeFileSync(`src/content/blog/${slug}.md`, `${fm}\n\n${turndown.turndown(body.html() ?? '')}\n`);
await new Promise((r) => setTimeout(r, 500));
}
The short pause between requests keeps the crawl polite. Review the output: Wix markup includes share buttons, like counters and “recent posts” blocks that may end up in the body. Remove them with body.find(...).remove() once you know their selectors, then rerun.
For a small blog, copying posts by hand into Markdown is often just as quick and gives cleaner results. The blog’s RSS feed is another source for recent posts.
Step 4: Download images
Wix serves images from static.wixstatic.com, usually with resizing parameters appended. Strip those to get the original file, then save it locally:
// scripts/wix-images.mjs
import { readFileSync, writeFileSync, mkdirSync, globSync } from 'node:fs';
mkdirSync('public/images', { recursive: true });
const pattern = /https:\/\/static\.wixstatic\.com\/media\/([^/\s)"]+?\.(?:jpe?g|png|webp|gif))[^\s)"]*/gi;
for (const file of globSync('src/content/blog/*.md')) {
let text = readFileSync(file, 'utf8');
for (const [full, name] of text.matchAll(pattern)) {
const res = await fetch(`https://static.wixstatic.com/media/${name}`);
writeFileSync(`public/images/${name}`, Buffer.from(await res.arrayBuffer()));
text = text.replaceAll(full, `/images/${name}`);
}
writeFileSync(file, text);
}
Rename the files to something descriptive as you go (Wix names are hashes), and add alt text. For images used in pages rather than posts, put them in src/assets/ and use <Image /> so Astro optimises them; see the Astro image component guide.
Step 5: Keep Wix’s blog URLs
Wix serves posts at /post/slug and the blog index at /blog. Keeping those paths avoids redirects entirely:
---
// src/pages/post/[slug].astro
import { getCollection, render } from 'astro:content';
import BaseLayout from '../../layouts/BaseLayout.astro';
export async function getStaticPaths() {
const posts = await getCollection('blog');
return posts.map((post) => ({ params: { slug: post.id }, props: { post } }));
}
const { post } = Astro.props;
const { Content } = await render(post);
---
<BaseLayout title={post.data.title} description={post.data.description}>
<article>
<h1>{post.data.title}</h1>
<Content />
</article>
</BaseLayout>
If you’d rather use /blog/slug, add a host-level 301 from /post/* to /blog/:splat. Wix category and tag pages (/blog/categories/name) can be rebuilt or redirected to the blog index.
Step 6: Redirect everything else
Go through the spreadsheet and write a redirect for every URL whose path changes. Host-level redirects return real 301 status codes, which is what search engines want:
# public/_redirects (Netlify and Cloudflare Pages)
/services-1 /services 301
/about-us /about 301
/blog/categories/* /blog/ 301
Wix sometimes generates URLs with suffixes like -1 or odd capitalisation, so check the list carefully. The redirects tip compares host redirects with Astro’s redirects config.
Step 7: Replace Wix apps
- Forms: a form backend or an Astro Action. See contact forms on a static Astro site.
- Email list: export contacts as CSV and import them into your email provider.
- Store: export products as CSV and import them into Shopify, Snipcart or another service.
- Bookings: an embed from a scheduling tool.
- Analytics: a privacy-friendly analytics script in your layout.
Step 8: Launch and monitor
- Build and preview; check every row in your spreadsheet returns 200 or 301.
- Deploy to your static host and update DNS at your registrar. If the domain was bought through Wix, transfer it or point its DNS records to the new host first.
- Submit the new sitemap in Search Console.
- Watch the Pages and crawl reports for a few weeks and fix any 404s you missed.
- Cancel the Wix plan only after traffic has settled.
FAQ
Can I export my Wix site to Astro?
No. Wix doesn’t offer a code export. You rebuild the design in Astro, copy or extract the content, and download images. Starting from an Astro theme reduces the rebuild work.
How do I get my blog posts out of Wix?
Read them from your published post pages with a script, using the sitemap to find every post, then convert the HTML to Markdown. For small blogs, copying posts manually into Markdown files is a fine alternative.
Will I lose my Google rankings moving from Wix?
Not if you keep URLs the same where possible, 301-redirect the rest, carry over titles and descriptions, and keep the content. A short dip is common while Google recrawls; it usually recovers within weeks.
What happens to my domain if I bought it through Wix?
You can transfer it to another registrar or keep it at Wix and change its DNS records to point at your new host. Make the DNS change only after the Astro site is deployed and tested.
Is Astro cheaper than Wix?
Usually. Astro is free and static hosting often costs nothing for small business sites, so you mainly pay for the domain and any services you add. The trade-off is that someone has to build and maintain the code.