I was using wordpress for more than 3 years, but last week moved my blog to gatsby and one of my main task was convert my wordpress posts to markdown.
I found a great nodejs script https://github.com/lonekorean/wordpress-export-to-markdown, it allow to convert from wordpress to markdown easy.
The script also can download images and create directory for each post, support organize by year or months.
1- Download all my posts from wordpress using the backup tool and renamed it to export.xml.
2- Clone the script from the github repo and install script dependecies.
git clone https://github.com/lonekorean/wordpress-export-to-markdown cd wordpress-export-to-markdown npm install
3- Move export.xml to wordpress-export-to-markdown directory and run index.js script.
The script ask list some question about how you want to export your posts.
Feel free to read full documentation in https://github.com/lonekorean/wordpress-export-to-markdown/blob/master/README.md