wordpress-api-to-markdown

wordpress-api-to-markdown

Create a folder of markdown files (in jekyll/hexo/eleventy style) from a Wordpress JSON API

🍱 Wordpress API to markdown

Takes all the posts from a Wordpress wp-api endpoint and writes them to disk as markdown.

This is an opinionated script for my own use cases, but I welcome PRs to make it more extensible.

Usage

npx wordpress-api-to-markdown --input example.org --output ./_posts/wordpress

This will crawl the wp-json API on example.org and write all the posts to markdown files in ./_posts/wordpress

Presently this tool does not download images, so the original Wordpress server will still be used to serve images.

Options

  • --force-permalink - write a permalink to the front matter. Used to work around wonky permalink implementations (Personally I can never get Hexo to work right).