Move WordPress posts into MDX files
Pauline used Claude Code to pull a WordPress archive into MDX and sort it into year folders.
- What they did
- Pauline asked Claude Code, working as a terminal-based agent, to take every post from her WordPress REST API, turn the content into MDX with frontmatter, and place the files into folders organized by year. It dealt with API limits, transformed HTML into Markdown, and retried after an encoding problem interrupted the script. Pauline supervised the process and checked the results while focusing on other work.
- How it went
- The transfer finished in roughly 4 hours and covered 367 posts plus 5 pages. Older entries with malformed image tags caused the build to fail, and Claude repaired those issues in bulk using a regex-based pass over the directory.
- Tips
- Legacy WordPress content often includes broken markup, so expect a few build failures during conversion. It helps to let the agent read the errors and apply fixes across the whole set instead of handling each file one by one.
Try it yourself with Claude Code
Collect all posts and pages from [WordPress site URL] using the REST API, convert each entry into an MDX file with frontmatter for [title/date/slug/tags/other fields], and save the files in [folder path] grouped by year. If you run into rate limits, encoding issues, or build errors from old HTML, stop and tell me what failed. Before any irreversible action like overwriting, deleting, sending, or submitting, show me the proposed change and wait for my approval. Finish by reporting how many posts and pages you converted and which items still need manual cleanup.
Fill in the [brackets]. Agents can make mistakes, so review anything before it is sent, paid or deleted.
1 more report of this
Get 3 agent uses like this every morning
With the day's top AI news. Free, and one click to unsubscribe.
Related agent uses
Use Claude Code to plan and run a legacy stack migration
An engineer used Claude Code to map, split, and execute a multi-repo migration while keeping each step tied to docs, tickets, and review.
Audit CSS with MDN-backed browser checks
An MCP add-on let Claude Code look up MDN guidance and browser support while reviewing CSS for likely issues.
Rebuild Claude hooks as a pi extension
A developer had an agent convert a folder of Claude Code hooks into a pi extension after switching tools.
Let an agent turn browser edits into code
A designer changed a local site in the browser while a coding agent wrote the matching CSS updates into the codebase.
Use Claude Code to revive an old assembly build
A developer used Claude Code to get a 1991 assembly game’s old tools compiling again on modern setup files.
Use a browser agent for setup tasks that come up while coding
A developer keeps coding in Claude Code while Claude in Chrome handles related web settings changes in the browser.