Convert WordPress content into reproducible MDX files
At a glance
A blog owner uses Claude to build a repeatable WordPress-to-Astro content pipeline with checks that protect manual edits. This workflow is listed under Content Migration, Personal Websites, Reproducible Workflows.
- Agents / tools
- Claude, Astro, WordPress REST API, Git
SourceBuilding a tool for these workflows? See weekly rates.
What they did
1) Give Claude a Git-tracked Astro workspace and your WordPress site's public REST API; use a WXR export if the API is unavailable. Record the migration decisions in CLAUDE.md. 2) Inventory posts, pages, and media with pagination, then cache the fetched JSON locally outside Git. 3) Have Claude build a converter from Gutenberg block HTML to MDX, mapping API fields into frontmatter. Stop on unrecognized blocks with the post slug and block class; download only referenced images. 4) Mark generated files and refuse to overwrite files without that marker. Fix conversion problems in the converter and rerun from the cache. 5) Check that every fetched item produced a file, build the site, and compare production-preview pages with screenshots of the original. Keep the reviewed MDX files as the migration output.
How it went
The author reports converting the posts with images, captions, and internal links intact.
Worth knowing
An earlier theme recreation passed ninety tests but mismatched the real site. The author added rendered-page and screenshot comparisons.