Allow users to write comments in Markdown format and automatically convert them into safe, semantic HTML on the frontend.
- Enables Markdown formatting in WordPress comments
- Parses common syntax:
**bold**,*italic*,`code`,[links](url), headings, and lists - Clean, minimal, and secure output
- Adds optional help text under the comment box
- Admin setting to enable/disable Markdown support
Once activated, the plugin:
- Adds a checkbox setting under Settings → Discussion to enable/disable Markdown comments.
- Displays a small hint below the comment textarea so users know they can use Markdown.
- Parses comment content using a custom Markdown parser before rendering.
- Strips conflicting WordPress formatting like
wpautopandwptexturize. - Outputs safe, sanitized HTML using
wp_kses_post().
- Upload the plugin to your
/wp-content/plugins/directory or install via the Plugins screen. - Activate the plugin.
- Visit Settings -> Discussion and check "Enable Markdown for Comments".
| Syntax | Example | Output |
|---|---|---|
| Bold | **bold** or __bold__ |
bold |
| Italic | *italic* or _italic_ |
italic |
| Inline Code | `code` |
code |
| Links | [text](https://example.com) |
text |
| Headings | # H1, ## H2, ... |
<h1>, <h2>, ... |
| Unordered Lists | - Item / * Item / + Item |
<ul><li>Item</li></ul> |
| Ordered Lists | 1. First 2. Second |
<ol><li>...</li></ol> |
| Paragraphs | Line breaks | Proper <p> tags |
- Uses
esc_html()andwp_kses_post()to sanitize all output. - Does not load external libraries — no JavaScript Markdown libraries, no front-end dependencies.
- Lightweight and fast — designed to work out of the box on most WordPress sites.
- You can customize the comment formatting logic by editing
markdown_comments_parse_markdown()andmarkdown_comments_apply_inline_formatting(). - The plugin does not allow raw HTML input in comments, keeping comment sections secure and clean.
- For advanced Markdown needs (e.g., tables, blockquotes), consider integrating a full Markdown parser (e.g., Parsedown) - but this plugin intentionally keeps it minimal for performance and security.
| Key | Value |
|---|---|
| Plugin Name | Markdown Comments for WordPress® |
| Version | 1.0.0 |
| Author | Robert DeVore |
| License | GPL-2.0 or later |
| Plugin URI | GitHub Repo |
| Requires PHP | 7.4+ |
| Requires WP | 5.5+ |
Q: Can users still use HTML in comments?
A: Only safe HTML output generated by Markdown is allowed. Raw HTML input is stripped for security.
Q: Does this support replies or threaded comments?
A: Yes. It works with any comment — top-level or nested.
Q: Will this affect existing comments?
A: Only if Markdown is enabled — and only when those comments are rendered. It doesn’t permanently alter comment data in the database.
- Add support for blockquotes (
>) - Toggle for displaying Markdown helper hint
- Extendable filters/hooks for developers
Pull requests and suggestions welcome! Feel free to fork the repo and submit improvements. For issues, use the GitHub issue tracker.
Markdown Comments for WordPress® is licensed under the GPL 2.0 or later.