Migrate WordPress posts to MDX
February 1, 2026 • Tech, Online. Task: February 1, 2026 • Tech, Online If you’re still running a Next.js front end on top of a WordPress backend, the short version is this: moving to local MDX made my setup simpler, faster, and far less annoying to maintain. In this case, Claude Code helped me migrate 367 posts and 5 pages from the WordPress REST API into local MDX files in a single afternoon. If you've been a longtime follower, you'd know that I was the biggest AI skeptic. I didn't understand it. I liked how I did things. I mean, if it worked, why fix it, right? My mind changed once I joined Vercel back in 2024. The team were just shipping the new version of v0 and I watched the community come equipped with all the questions across platforms. The only way to help them was to fully understand the product by actually building. Unsurprisingly, I got hooked on "vibe coding". I started to enjoy sharing my tips on better prompting and my little side projects with our users. My AI toolkit grew: I used v0, Cursor and occasionally ChatGPT and Gemini daily. Over the last two weeks, Claude Code was trending on X and everyone around me seemed to be building agents. I watched a couple of demos, and thought about all the things that I'd love a virtual assistant to help me with. Today it has become the tool for me when it comes to development work. I've shipped code (and my ideas!) faster than I have ever done in years. It's also just been super fun, because it feels like I'm back in my hackathon days where the only limit is your imagination and I guess the 24 hours 😂 This weekend I wanted to play around a bit more with some agents I'd already started building and remembered that I had this "move off WordPress" project I've been putting off for months... Claude Code handled it all in a single session. In short Moving from a WordPress-backed setup to local MDX made my blog simpler, faster, and easier to maintain. Claude Code was most useful as a terminal agent handling the repetitive migration work, while I focused on direction and review. Moving from WordPress API calls to local MDX removed a lot of unnecessary complexity from my blog. Claude Code was most useful as a terminal agent, not just a chatbot. The real win was not just speed, but how much easier the setup is to maintain now. Why I wanted to migrate off WordPress For context, the front end of my blog has been running on Next.js, but it was still fetching all the content from WordPress via their REST API. Before this set-up, I was all-in with WordPress and... was developing on /shudders/ PHP. I had already tried to make WordPress less painful by offloading blog images to AWS S3, but the backend still felt heavier than it needed to be. My setup was unnecessarily complex: EC2 instance on AWS and Next.js app on Vercel. Every time I wanted to publish a post I had to go into my laggy WordPress instance to publish and I often hit API timeouts during builds. When something broke, it was frustrating not knowing which dependency it was that caused it. 😬 I still like simple deployment flows for small websites, and I wrote about a few of them in four simple ways to deploy your small website. What Claude Code actually handled Watching Claude plan and execute code was so fun. I didn't just use Claude as a chatbot. I used it as a terminal agent. I gave it a high-level goal: Extract all posts from my WordPress REST API, convert them to MDX with proper frontmatter, and save them into a year-based folder structure. It handled the rate-limiting on the API, parsed the messy HTML into clean Markdown, and even re-ran the script when it found a character encoding error. It migrated all 367 posts and 5 pages to local MDX files stored in the repo. Here's what that means: Each post is now a markdown file with frontmatter: What changed after moving to local MDX All my images are now optimized through Next.js Image optimization. Every image gets: Automatic WebP/AVIF conversion Lazy loading Responsive sizing CDN caching And because the content is local, I can now do things like: Bulk find-and-replace across all posts Version control on content changes Automated content processing Git-based workflows Technical stack Why this felt like the future of development Here's what gets me excited: this entire migration happened in one afternoon. Just me, Claude Code, and a clear goal. I gave it the plan, and it executed autonomously: Installed dependencies Created migration scripts Converted all 367 posts Updated application code; tools: Claude Code. Human role: The original post does not say how a person stayed involved.; limitations: This workflow assumes access to a WordPress REST API and a Next.js frontend. The agent required human intervention to define the folder structure and frontmatter schema. Reliability depends on the agent's ability to handle edge cases like broken image tags, which it resolved via regex fixes. Source is a personal blog post, so results may vary based on content volume and API stability..
Tools
Published on Agent Work Atlas:
Overview
February 1, 2026 • Tech, Online
Workflow
February 1, 2026 • Tech, Online If you’re still running a Next.js front end on top of a WordPress backend, the short version is this: moving to local MDX made my setup simpler, faster, and far less annoying to maintain. In this case, Claude Code helped me migrate 367 posts and 5 pages from the WordPress REST API into local MDX files in a single afternoon. If you've been a longtime follower, you'd know that I was the biggest AI skeptic. I didn't understand it. I liked how I did things. I mean, if it worked, why fix it, right? My mind changed once I joined Vercel back in 2024. The team were just shipping the new version of v0 and I watched the community come equipped with all the questions across platforms. The only way to help them was to fully understand the product by actually building. Unsurprisingly, I got hooked on "vibe coding". I started to enjoy sharing my tips on better prompting and my little side projects with our users. My AI toolkit grew: I used v0, Cursor and occasionally ChatGPT and Gemini daily. Over the last two weeks, Claude Code was trending on X and everyone around me seemed to be building agents. I watched a couple of demos, and thought about all the things that I'd love a virtual assistant to help me with. Today it has become the tool for me when it comes to development work. I've shipped code (and my ideas!) faster than I have ever done in years. It's also just been super fun, because it feels like I'm back in my hackathon days where the only limit is your imagination and I guess the 24 hours 😂 This weekend I wanted to play around a bit more with some agents I'd already started building and remembered that I had this "move off WordPress" project I've been putting off for months... Claude Code handled it all in a single session. In short Moving from a WordPress-backed setup to local MDX made my blog simpler, faster, and easier to maintain. Claude Code was most useful as a terminal agent handling the repetitive migration work, while I focused on direction and review. Moving from WordPress API calls to local MDX removed a lot of unnecessary complexity from my blog. Claude Code was most useful as a terminal agent, not just a chatbot. The real win was not just speed, but how much easier the setup is to maintain now. Why I wanted to migrate off WordPress For context, the front end of my blog has been running on Next.js, but it was still fetching all the content from WordPress via their REST API. Before this set-up, I was all-in with WordPress and... was developing on /shudders/ PHP. I had already tried to make WordPress less painful by offloading blog images to AWS S3, but the backend still felt heavier than it needed to be. My setup was unnecessarily complex: EC2 instance on AWS and Next.js app on Vercel. Every time I wanted to publish a post I had to go into my laggy WordPress instance to publish and I often hit API timeouts during builds. When something broke, it was frustrating not knowing which dependency it was that caused it. 😬 I still like simple deployment flows for small websites, and I wrote about a few of them in four simple ways to deploy your small website. What Claude Code actually handled Watching Claude plan and execute code was so fun. I didn't just use Claude as a chatbot. I used it as a terminal agent. I gave it a high-level goal: Extract all posts from my WordPress REST API, convert them to MDX with proper frontmatter, and save them into a year-based folder structure. It handled the rate-limiting on the API, parsed the messy HTML into clean Markdown, and even re-ran the script when it found a character encoding error. It migrated all 367 posts and 5 pages to local MDX files stored in the repo. Here's what that means: Each post is now a markdown file with frontmatter: What changed after moving to local MDX All my images are now optimized through Next.js Image optimization. Every image gets: Automatic WebP/AVIF conversion Lazy loading Responsive sizing CDN caching And because the content is local, I can now do things like: Bulk find-and-replace across all posts Version control on content changes Automated content processing Git-based workflows Technical stack Why this felt like the future of development Here's what gets me excited: this entire migration happened in one afternoon. Just me, Claude Code, and a clear goal. I gave it the plan, and it executed autonomously: Installed dependencies Created migration scripts Converted all 367 posts Updated application code
Reported result
The migration was completed in a single afternoon, replacing a complex EC2/WordPress backend with a simpler local MDX setup on Vercel. The author reports faster builds, elimination of API timeouts, and easier maintenance via Git-based workflows. No specific performance metrics or cost savings were measured, but the structural complexity was significantly reduced.
Human role
The original post does not say how a person stayed involved.
Limitations
This workflow assumes access to a WordPress REST API and a Next.js frontend. The agent required human intervention to define the folder structure and frontmatter schema. Reliability depends on the agent's ability to handle edge cases like broken image tags, which it resolved via regex fixes. Source is a personal blog post, so results may vary based on content volume and API stability.
Try it
Act as a senior developer using Claude Code to migrate my WordPress blog to local MDX. My WordPress site is at [replaceable_url] with API key [replaceable_key]. Target repo is [replaceable_repo]. Goal: Extract all posts and pages, convert HTML to MDX with frontmatter (title, date, slug), and save to /content/posts/[year]/. Steps: 1. Install dependencies. 2. Write a script to fetch posts, handling rate limits. 3. Convert content, fixing encoding errors. 4. Update Next.js config to read local MDX. 5. Run a dry migration on 5 sample posts. Show me the output files and build logs. Wait for my confirmation before running the full migration. If errors occur, propose fixes but do not apply them without approval. Ensure no data is lost.
Source reports are not independently verified. Publication date is the catalog publication date, not the original article date.