Top 200 ReposEXPLORER
Browse agents, categories and pages
Planned, not doneThe source describes an intention, not a finished result.

Migrate WordPress Posts to MDX

Overview

Have Claude Code write and run a script that pulls posts from a WordPress site's REST API and turns each one into an MDX file with front matter, then review a sample before converting the rest.

Problem or Objective

More in Coding and Code Review

AI Agents and Models

Tools and Integrations

Tools
Claude Code · WordPress · MDX
Prerequisites
Claude Code, a WordPress site whose REST API is reachable, and a static site project that renders MDX.

How It Works

In the repository of your new site, start Claude Code and describe the target: one MDX file per post in a content folder, with front matter for title, date, slug, excerpt, categories and tags. Ask it to write a small script that pages through the posts endpoint of your WordPress site's REST API, converts each post's HTML body to MDX, rewrites internal links to the new paths and lists every shortcode or embed it could not convert. Have it run the script on five posts first and show you the files. Check them in your local build, adjust the rules, then let it run the full export. Finally, ask it to produce a redirect list from old to new URLs and a report of posts needing manual fixes, and commit the result on a branch for review.

Implementation Workflow

Steps assembled from the agents, tools and prompt of this entry. Adapt them to your own setup.

  1. Choose the agentSet up Claude Code.
  2. Connect the toolsConnect the tools this workflow relies on: Claude Code, WordPress, MDX.
  3. Check the prerequisitesClaude Code, a WordPress site whose REST API is reachable, and a static site project that renders MDX.
  4. Gather your detailsCollect what the prompt asks for: Script language, WordPress site address, Target folder, New URL pattern.
  5. Run the starter promptPaste the starter prompt below into Claude Code and adapt it to your case.
  6. Check against the documentationCompare what you get with the documentation at code.claude.com before you rely on it.

Practical Starter Prompt: Export WordPress posts to MDX files

Fill the fields to adapt the prompt. Empty fields stay as visible [placeholders].

Preview
Write a script in [Script language] that reads all published posts from the REST API of [WordPress site address] and writes one MDX file per post to [Target folder], with front matter for title, date, slug, excerpt, categories and tags. Convert the HTML body to MDX, rewrite internal links to the pattern [New URL pattern], and log every shortcode or embed you cannot convert. Run it on the first five posts only, show me the output and wait for my approval before doing the rest. Then produce a redirect list and commit on a new branch; do not push or deploy.

Review the five sample files in your local build before approving the full run. You push the branch and switch redirects yourself after checking the report.

Expected Results and Benefits

This is a suggested workflow, not a reported result. The points below are what the cited documentation says the tools can do.

This is a suggested workflow, not a reported outcome. The Claude Code docs describe an agentic coding tool that reads your codebase, edits files and runs commands, and lists tedious tasks such as updating dependencies among its uses. They do not mention WordPress or MDX, so the conversion quality depends on the script you review. How your WordPress site exposes posts and media through its REST API was not verified here.

Limitations and Considerations

Check whether your WordPress site exposes the posts you need through its REST API without logging in; drafts and private posts may need credentials, which you should keep out of the repository. Images usually stay on the old host until you copy them, so plan media and redirects before switching domains. Check which commands your Claude Code permission settings let it run without asking before you start the full export. Results depend on your setup and were not independently reproduced by Top 200 Repos.

GitHub Repositories

AI Agent Repository

Source code of the agent that does the work.

Official Website

The official site of the main tool or project in this use case.

Visit Website (opens in a new tab)code.claude.com

Related Videos

About anthropics/claude-code

About anthropics/claude-code

Independent creators. Listing a video implies no endorsement, sponsorship or partnership.

Sources

  1. Overview - Claude Code Docs (opens in a new tab)

    Project documentation · code.claude.com · Undated · Source checked 25 Nov 2026, 11:57 UTC

    What this source supports
    • Claude Code is an agentic coding tool that reads your codebase, edits files, runs commands and integrates with your development tools.
    • It handles tedious tasks such as writing tests for untested code, fixing lint errors across a project, resolving merge conflicts and updating dependencies.
  2. anthropics/claude-code README (opens in a new tab)

    Project documentation · github.com · Undated · Source checked 25 Nov 2026, 11:59 UTC

    What this source supports
    • Claude Code lives in your terminal, understands your codebase and helps you code faster by executing routine tasks, explaining complex code and handling git workflows through natural language commands.
Report a problem

More with Claude Code

Planned, not done

Create Custom Store Tools Instead of Paying for Subscriptions

Use Claude Code to write small in-house tools for an online shop, such as a reply helper for support mail or a margin report, as an alternative to paying for separate apps, with testing before you rely on them.

code.claude.comanthropics/claude-code
Reported by source

Answer technical questions by letting async agents run experiments

Simon Willison sends research questions to cloud coding agents such as Claude Code for web and Codex Cloud, which write and run experiments in a dedicated repo and open a PR.

simonwillison.net · 6 Nov 2025anthropics/claude-code, openai/codex
Planned, not done

Structure Repeated Browser Research Into Evidence Tables

Give Claude Code the open-source Browser Use CLI with a local browser, ask the same research questions across a short list of pages, and keep every answer as a sourced table row.

github.comanthropics/claude-code, browser-use/browser-use

View all: Claude Code