How to Export WordPress Content to Markdown

Markdown is a lightweight, future-proof format used by static site generators, documentation platforms, and personal archives because it is easy to read and preserves formatting without the “code bloat” of HTML. This guide walks you through the entire conversion process on Windows 11.

1. System Requirements & Environment Setup

To run the necessary conversion scripts, you must install Node.js.

Installing Node.js on Windows 11

  1. Download: Visit Nodejs.org and select the LTS (Long Term Support) version for maximum stability.
  2. Install: Open the installer and click Next through all standard prompts.
  3. Verify: * Right-click the Start button and select Terminal.
    • Type node -v and hit Enter. If a version number (e.g., v22.13.1) appears, the installation was successful.

Fixing the “NPM” Folder Error

If you encounter a “missing directory” error later, you likely need to create a folder that the installer occasionally skips:

  • Press Win + R, type %AppData%\Roaming, and hit Enter.
  • Check for a folder named npm. If it is missing, right-click and create a new folder named npm.

2. Exporting Data from WordPress

Choose the method that best fits the complexity of your site’s data.

Native WordPress Export (XML)

  • Best for: Standard posts, pages, and categories.
  • Process: Navigate to Tools > Export in your dashboard, select All Content, and download the XML file.
  • Preparation: Rename the file to export.xml and place it in a dedicated folder (e.g., C:\WP_Export\).

WP All Export Pro (CSV & ACF)

  • Best for: Sites using Advanced Custom Fields (ACF) or highly structured technical data.
  • Process: Create a New Export, select your post type, and drag your specific custom fields into the export columns.
  • Format: Export as a CSV. This provides a clean spreadsheet format that can be easily mapped into Markdown headers.

3. The Conversion Process

Transform your export files into clean Markdown documents.

Converting XML with the Wizard

  1. Open your Terminal inside your export folder.
  2. Run the command: npx wordpress-export-to-markdown.
  3. Wizard Recommendations:
    • Folder Structure: Select “No” for year/month folders to keep your archive flat and easy to search.
    • Custom Post Types: Select Yes to ensure specialized data is captured.
    • Images: Select No if you only require a lightweight text archive.

4. The Master Merge

To create a single, searchable document of your entire site, merge the individual Markdown files.

  1. Open the Terminal in your output folder.
  2. Run the command: type *.md > Master_Archive.txt.

Quick Command Cheat Sheet Reference:

WordPress to Markdown: Command Cheat Sheet

1. Environment Check

Run these to ensure your PC is ready to handle the scripts.

  • Check Node version: node -v
  • Check NPM version: npm -v

2. Conversion Commands

Navigate to your export folder in the Terminal (cd path/to/folder) and run:

  • Run XML to Markdown Wizard: npx wordpress-export-to-markdown
  • Force a specific input file (if wizard fails): npx wordpress-export-to-markdown --input export.xml

3. The “Master Merge” (Windows 11)

Run this inside your output folder to combine hundreds of files into one searchable document.

  • Merge all Markdown files: type *.md > Master_Archive.txt
  • Merge safely (to Desktop) to avoid infinite loops: type *.md > %USERPROFILE%\Desktop\Master_Archive.txt

4. Cleanup & Maintenance

  • Update NPM (Package Manager): npm install -g npm@latest
  • Clear Script Cache (if wizard glitches): npm cache clean --force

Final Pro-Tip for Windows 11 Users

If you ever get the “File not found” error again while running the wizard, remember the Drag and Drop trick:

  1. Type npx wordpress-export-to-markdown
  2. When it asks for the path, drag your XML file from your folder directly into the terminal window. It will paste the perfect path for you automatically.

Leave a Reply

Get in Touch

Please fill out the form below and we will get back to you ASAP

  • This field is for validation purposes and should be left unchanged.