Basis: the final result of our work on the plugin, including all discussed improvements: PHP/WP checks, localization, JS minification, smooth notifications, .po/.json support, and wordpress.org requirements.
The plugin adds an “Export to Markdown” panel to the Gutenberg block editor, allowing you to:
- download the current post as a
.mdfile; - copy the Markdown to the clipboard.
Conversion is performed in the browser via the Turndown library. The plugin makes no external requests, does not save files on the server, and works completely locally.
YAML front matter is generated: title, slug, date, categories, tags.
The plugin is optimized for wordpress.org requirements: uses wp_set_script_translations, has minimal load, supports localization, and correctly checks PHP/WP versions.
- Export Markdown directly from the Gutenberg editor.
- Two modes:
.mddownload and Markdown copy. - Automatic front matter.
- Supports all standard Gutenberg blocks.
- Smooth notification animations.
- Full localization (EN, RU, UK, DE, ES, IT, FR).
- Minified JS version (
export-md.min.js) with automatic switching based onSCRIPT_DEBUG. - PHP/WP version checks and automatic deactivation if requirements are not met.
- WordPress 6.0+
- PHP 7.4+
- Active Gutenberg editor
The code technically works from PHP 5.3, but the official minimum is set to 7.4.
-
Copy the
simple-export-mdfolder intowp-content/plugins/ -
Ensure it contains:
simple-export-md.phpassets/export-md.jsassets/export-md.min.jsassets/turndown.jslanguages/with.poand.jsonfiles
-
Activate the plugin in the “Plugins” menu.
-
Open any post/page in Gutenberg.
-
Enable the right settings panel (⚙ icon).
-
Find the Export to Markdown section.
-
Click:
- Download .md — to download the file,
- Copy Markdown — to copy it to the clipboard.
After completion, a smooth notification will appear.
simple-export-md/
simple-export-md.php
assets/
export-md.js
export-md.min.js
turndown.js
languages/
simple-export-md-ru_RU.po
simple-export-md-uk.po
simple-export-md-de_DE.po
simple-export-md-es_ES.po
simple-export-md-it_IT.po
simple-export-md-fr_FR.po
*.json (generated by wp i18n make-json)
readme.txt
For JS localization WordPress requires .json files.
Generate them with:
wp i18n make-json languages --no-purge
or on Windows:
npx @wordpress/i18n-cli make-json languages --no-purge
Ukrainian must use the code uk (not uk_UA).
The minified version is built using terser:
npx terser assets/export-md.js -c -m -o assets/export-md.min.js --source-map
The plugin selects automatically:
export-md.min.js— in production,export-md.js— whenSCRIPT_DEBUGis enabled.
The plugin checks:
- PHP >= 7.4
- WordPress >= 6.0
If requirements are not met:
- an admin notice is shown,
- the plugin deactivates itself,
- further loading stops.
This prevents potential fatal errors.
- Custom blocks are exported as HTML fragments (standard for Markdown converters).
- Media files are not downloaded or packaged — absolute URLs are used.
- Clipboard API must be available in the browser.
- Export ZIP archive with media files.
- Front matter settings.
- Support for custom blocks.
- Hotkeys and quick actions.
GPLv2 or later.
© 2025 Pavel Sherer (sherer.pro)