← Back to library

Migrate a blog off a CMS to local Markdown files

Pauline P. Narvas had put off leaving a heavy CMS for months. In a single session, a terminal coding agent pulled every post via the CMS API, turned untidy HTML into neat Markdown files with frontmatter and organized files by year. It coped with rate limits and a character-encoding error without help, moving 367 posts and five pages.

  • OutcomeMove hundreds of posts from a heavy CMS to local Markdown in one afternoon by having a terminal agent handle the repetitive extraction and conversion.
  • SetupAn afternoon+
  • LevelIntermediate
  • CreditPauline P. Narvas
View original
Works with
Claude Code

Published Oct 23, 2026Updated Oct 23, 2026AI dry run on sample input: passed Oct 23, 2026Source verified Oct 23, 2026

When should you use it?

  • Your site fetches content from a heavy CMS
  • You want local Markdown and a simpler stack
  • You can review and spot-check the output

Not for: Deleting the source before verifying every post migrated; Highly dynamic sites that need more than static content

What do you need, and what do you get?

You need

  • API access to the existing CMS
  • A target repo and folder structure
  • A terminal coding agent

You get

  • Every post as a local Markdown file with metadata
  • Posts organized by publication year
  • A simpler, faster, local-content stack

How does it work, step by step?

  1. Give one clear goalTell the agent to extract all posts, convert to Markdown with frontmatter and file them.
  2. Let it handle the APIIt manages rate limits and pagination rather than you scripting each call.
  3. Have it clean the HTMLIt parses messy markup into clean Markdown and sets the frontmatter fields.
  4. Let it self-correctWhen it hit an encoding error, it re-ran the script; allow that loop.
  5. Verify before cutoverSpot-check posts and images, then keep the old source until you trust the new one.

The prompt

Our own prompt, inspired by Pauline P. Narvas and written to work in Claude Code. Values in lime are placeholders.

Prompt0 variables
Pull every post and page from my CMS at [API endpoint], convert them to Markdown with proper frontmatter (title, date, categories, excerpt, author, slug), and save them by publication year in this repo. Handle rate limiting and pagination, and parse the HTML into clean Markdown. If you hit an encoding or parsing error, fix it and re-run. Report how many posts and pages migrated and flag anything that failed.

Inspired by Pauline P. Narvas: WordPress to MDX migration with Claude Code. The prompt above is written by playbooks.bot in our own words; nothing from the original is quoted.

What can go wrong?

  • Confirm every post and image migrated before retiring the CMS.
  • Dynamic features beyond content may still need work; this covers posts and pages, not plugins.

Our take

Pauline P. Narvas's migration shows which jobs belong to terminal agents rather than chat windows. Moving a blog means calling an API repeatedly, waiting out rate limits, cleaning HTML, writing hundreds of files and rerunning scripts when something breaks, and an agent that can execute code handles that loop well. Giving it one clear goal and letting it manage the mechanics was the right approach. The discipline to keep is verification before cutover. Spot-check a sample of posts from different years, especially ones with embedded media, tables, code blocks or unusual characters, since the encoding error shows these are where conversions fail. Check that images were downloaded rather than still pointing at the old CMS, which may disappear when you cancel it. Keep URLs identical or add redirects, because old links from search engines and other sites are a blog's main traffic. Leave the old site running until the new one has been live for a while, and keep a full export of the CMS content as a backup in case something surfaces months later.

Where the time goes back: A dreaded multi-day migration that sat on the backlog for months finishes in one afternoon of mostly review.

FAQ

How long did it take?
A migration the author expected to take days was done in one afternoon session.
Did it need babysitting?
Little. It handled rate limiting, parsing and even fixed an encoding error itself.

Source and credit

Inspired by Pauline P. Narvas. We describe the idea in our own words, link to the original, and wrote the prompt ourselves; nothing is quoted.

Inspired by
WordPress to MDX migration with Claude Code
Creator
Pauline P. Narvas
Published on
pawlean.com
Original date
Feb 1, 2026
License
Not openly licensed (the poster keeps all rights), so we quote nothing and link to the original
Originally for
Claude Code
AI dry run
Oct 23, 2026: passed. Dry-run tested by our AI test agent on sample input. PASS: Gates held on desk check; no live sends or purchases.
AI dry run on sample data; not run with live connected accounts. The playbooks.bot test agent filled the prompt with synthetic inputs, produced the output and checked it against the page's stated outputs and guardrails.
Verified
Oct 23, 2026: source link resolves to the original, the credited creator published it, our excerpt or prompt matches it, and the license allows our use.

Are you the creator? Claim or correct this page.

More in Operations & Admin

All 203 Operations & Admin playbooks →

Related playbooks

Operations & AdminWorkflow✓ AI dry run

Give Claude Code a git-backed memory it maintains itself

Keep your working rules and your project history in separate git repositories of plain markdown, use Claude Code hooks to load a short slice of the right rules at the start of each session, block risky actions until the matching rules are loaded, and have the agent append dated notes and commit them at the end of each task.

Credit: u/tahayelkenci on r/ClaudeCode

An afternoon+
Operations & AdminWorkflow✓ AI dry run

Share one to-do list between your team and your agents

Run a normal task list where people and AI agents both take tasks, update progress, and send finished work back for review.

Credit: Pete Callaghan (@petecallaghans)

An afternoon+
Operations & AdminPrompt✓ AI dry run

Aim the agent at a janky internal app after it maps the UI

Have the agent study a janky internal UI out loud, complete one end-to-end task with a recording, and stop for login walls instead of guessing credentials.

Credit: Carnage (@0xCarnagee)

Under an hour
Operations & AdminWorkflow✓ AI dry run

Give your bot an email address on your domain

Give an always-on bot a mailbox on your own domain through a custom connector, and wake it with a signed webhook when mail arrives.

Credit: u/Jcoulaud on r/GrokBot

Under an hour
Operations & AdminWorkflow✓ AI dry run

Let a calling agent ask you questions mid-call

Give a terminal agent a phone voice, plus a live dashboard where it routes questions it cannot answer to you without hanging up.

Credit: BOOTOSHI (@KingBootoshi)

An afternoon+