wordpress-api-to-markdown

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

Usage no npm install needed!

<script type="module">
  import wordpressApiToMarkdown from 'https://cdn.skypack.dev/wordpress-api-to-markdown';
</script>

README

🍱 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).