When readers paste a technical article from WordPress into an AI assistant, they rarely want theme sidebars, navigation menus, or Cookie banners. They want the heading structure, fenced code blocks, and links cleanly preserved as Markdown.
To solve that cleanly without adding heavy runtime dependencies, we built and open-sourced copy-markdown-for-ai for WordPress.
What the Plugin Does
Instead of scraping rendered HTML with complex client libraries at every page load, the plugin renders a compact action bar (.cmfai-bar) alongside post content with direct copy and download actions:
-
One-click Markdown copy: Copies structured article content to the clipboard and switches button state (
is-copied/Copied Markdown to clipboard.). -
Direct
.mddownload: Downloads a clean Markdown file named from the post slug (for example,hello-world.mdat179 byteson a default test post). -
Zero-bloat packaging: All store icons, banners,
src/,node_modules/, and CI files stay outside the distribution archive via.distignore.
Verification Before Submission
Before submitting to the WordPress.org Plugin Directory, we ran three concrete checks:
-
Automated CI (Run 46810041142):
php-lint,build-and-lint, andWordPress/plugin-check-action@v1.1.9all passed cleanly. -
WordPress Playground Live Check: Verified in a real browser (
HTTP 200, 4 buttons rendered, clipboard feedback verified,.mddownload verified,0console JS errors). -
Archive Size & Contents: The distributable
copy-markdown-for-ai.zipweighs 17,922 bytes across 18 entries (copy-markdown-for-ai.php,includes/,build/,readme.txt,uninstall.php).
Source Code
The MIT/GPL-compatible WordPress plugin source is public on GitHub:
https://github.com/kanta13jp1/copy-markdown-for-ai
How are you making your documentation or blog posts easier to reuse with AI tools—do you expose raw .md endpoints, llms.txt, or UI copy buttons?
Top comments (0)