Migrate a WordPress-backed blog into local MDX files
At a glance
A developer used Claude Code to migrate 367 posts and five pages from WordPress into a simpler Next.js content workflow. This workflow is listed under Content Migration, Web Development, Static Content.
- Agents / tools
- Claude Code, WordPress REST API, Next.js, MDX
SourceBuilding a tool for these workflows? See weekly rates.
What they did
1) Have the existing Next.js repository, access to its WordPress REST content API and permission to change the deployment. Run Claude Code as a terminal agent in the project. 2) Ask it to fetch the posts, convert HTML to Markdown with MDX frontmatter, and save files in year-based folders. Include metadata such as title, date, category, author and slug. 3) Let it create and run migration scripts, handle rate limits and correct encoding errors. Update the app to read local content rather than the WordPress API. 4) Run the build, inspect failures and repair malformed content, including broken image tags. Review the migrated files and application changes, then commit and deploy the working site.
How it went
The author reported completing the migration in one afternoon, with a four-hour effort listed in the comparison table.
Worth knowing
Legacy HTML caused both encoding and image-tag failures, so copying the files alone did not complete the migration.