Skip to content
Less of Lee
Go back

Migrating from WordPress to Astro

After years on WordPress.com, I’ve migrated this blog to a completely new stack. Here’s why and how.

Why Leave WordPress?

WordPress.com served me well, but I wanted:

The New Stack

LayerTechnology
FrameworkAstro
HostingCloudflare Pages
ContentMarkdown files
SearchPagefind (static, client-side)
ImagesOptimized at build time with Sharp

Why Astro?

Astro is a static site generator designed for content-focused websites. Key benefits:

Why Cloudflare Pages?

The Migration Process

The migration involved:

  1. Export content from WordPress (Tools → Export → All content)
  2. Convert the XML export to Markdown files with a custom Node.js script
  3. Download all images locally so they’re optimized at build time
  4. Generate redirects so old URLs still work (SEO continuity)
  5. Deploy to Cloudflare Pages

The conversion script handles the messy parts: WordPress’s HTML-heavy content becomes clean Markdown, images are downloaded from WordPress.com servers to live in the repository, and a _redirects file ensures old links don’t break.

What’s Different

Faster: Pages load almost instantly. No waiting for WordPress to query a database and render PHP.

Simpler: No plugins to update, no security vulnerabilities to patch, no admin dashboard to maintain.

Portable: The entire blog is a folder of Markdown files. If Cloudflare disappeared tomorrow, I could deploy to Netlify, Vercel, or GitHub Pages in minutes.

Searchable: Pagefind indexes the site at build time. Search works entirely in your browser - no server required.

What’s the Same

The content. Every post made the journey. URLs redirect properly. RSS feed still works.

Source Code

The site is open source. You can see exactly how it’s built:

If you’re considering a similar migration, feel free to use it as a reference.


This post marks the first deployment to the new infrastructure. If you’re reading this, the migration worked.


Share this post on:

Next Post
Ralph Wiggum Testing: A Comprehensive Guide