How to export WordPress content to text files/markdown?

@judytuna, in your experiments with Migrating Spot from Wordpress to Hugo and Migrating Spot from Wordpress to Eleventy, you exported your content from WordPress as markdown files.

How did you do that?

Also, I notice some front-matter differences between experiments (to be expected), for instance, between the “Hello World!” posts:

Did your method add front matter? Were there options to output specific front matter, or manual adjusting on your part? :slight_smile:

I used a Wordpress Plugin from the official WP downloader GUI. WP Export to Gatsby, but it’s not Gatsby-specific.

I chose it because it looked easy and had lots of ratings in the WP plugin “store” , as well as this blog post. haha

I used search-all-and-replace-all to mess with the front matter after exporting to markdown. I started from the same md file contents for each project.

I know there are command-line tools with more options, including this plugin itself: wp-gatsby-markdown-exporter/ at master · tinacms/wp-gatsby-markdown-exporter · GitHub

There are also scripts by other people that take the contents of a vanilla Wordpress content export and munge them into md files. I didn’t try any. I just went with a GUI option that looked easy!

(I’m code-ing out links because I can’t post more than one as a new member)

1 Like

In this commit, you can see the default front matter exported by the wp-to-gatsby plugin:

Those files were how it looked right after running the export!

1 Like

Thanks! That plugin seems really useful:

  • it allows mapping of fields on the export (GUI)
  • has wp-cli commands for CLI

I’ll give it a try next time I need to export to markdown: