WP Markdown Comments
Yet Another Markdown plugin for Wordpress, but this one is for comments.
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/znuff/wp-markdown-comments/archive/refs/heads/master.zipA WordPress plugin that enables GitHub Flavored Markdown (GFM) support for comments, allowing commenters to write rich, formatted comments using Markdown syntax.
Features
- ✅ GitHub Flavored Markdown (GFM) - Full support for GFM syntax including tables, strikethrough, and task lists
- ✅ Live Preview - Real-time preview of formatted comments before submission
- ✅ Markdown Toolbar - Quick-access buttons for common Markdown formatting
- ✅ XSS Protection - Built-in sanitization using WordPress's
wp_kses()function - ✅ Configurable - Admin settings to enable/disable features and control allowed HTML tags
- ✅ Safe Mode - Parsedown safe mode enabled by default to prevent malicious code injection
- ✅ Seamless Integration - Works with your existing WordPress theme
Installation
Manual Installation
- Download the plugin files
- Upload the
wp-markdown-commentsfolder to/wp-content/plugins/directory - Activate the plugin through the 'Plugins' menu in WordPress
- Go to Settings → Markdown Comments to configure the plugin
Configuration
After activation, navigate to Settings → Markdown Comments in your WordPress admin panel:
- Enable Markdown: Turn Markdown parsing on/off
- Live Preview: Allow users to preview formatted comments
- Show Toolbar: Display formatting toolbar above comment field
- Allowed HTML Tags: Customize which HTML tags are allowed in rendered Markdown
Supported Markdown Syntax
Text Formatting
**bold text**
*italic text*
~~strikethrough~~
`inline code`
Links and Images
[Link text](https://example.com)

Headings
# Heading 1
## Heading 2
### Heading 3
Lists
- Unordered list item
- Another item
1. Ordered list item
2. Another item
Blockquotes
> This is a quote
> Multiple lines
Code Blocks
```javascript
function hello() {
console.log("Hello World");
}
```
Tables (GFM)
| Column 1 | Column 2 |
|----------|----------|
| Cell 1 | Cell 2 |
| Cell 3 | Cell 4 |
Horizontal Rules
---
Security
This plugin implements multiple layers of security:
- Parsedown Safe Mode: Escapes HTML in Markdown input
- WordPress Sanitization: All output is filtered through
wp_kses()with configurable allowed tags - Nonce Verification: AJAX requests are protected with WordPress nonces
- Input Validation: All user input is properly escaped and validated
Requirements
- WordPress 5.0 or higher
- PHP 7.0 or higher
Frequently Asked Questions
Does this work with my theme?
Yes, the plugin uses WordPress standard hooks and filters to integrate seamlessly with any properly coded WordPress theme.
Can I disable Markdown for specific posts?
Currently, the plugin applies to all posts where comments are enabled. Future versions may include per-post control.
What happens to existing comments?
Existing comments remain unchanged. Only new comments written after plugin activation will be parsed as Markdown. You can edit old comments to add Markdown formatting.
Is the Markdown stored in the database?
Yes, the original Markdown is stored in comment meta (_markdown_source), and it's converted to HTML when displayed. This allows you to disable the plugin without losing formatting.
Development
Plugin Structure
wp-markdown-comments/
├── wp-markdown-comments.php # Main plugin file
├── includes/
│ ├── class-markdown-parser.php # Markdown parsing logic
│ ├── class-comment-handler.php # Comment hooks and filters
│ ├── class-admin-settings.php # Admin settings page
│ └── class-frontend-assets.php # CSS/JS enqueuing
├── assets/
│ ├── js/
│ │ └── markdown-comments.js # Frontend JavaScript
│ └── css/
│ └── markdown-comments.css # Styling
└── lib/
├── Parsedown.php # Parsedown library
└── ParsedownExtra.php # ParsedownExtra (GFM support)
Changelog
1.0.0
- Initial release
- GitHub Flavored Markdown support
- Live preview functionality
- Markdown toolbar
- Admin settings page
- XSS protection and sanitization
Credits
This plugin uses Parsedown v1.8.0 by Emanuil Rusev for Markdown parsing with GitHub Flavored Markdown (GFM) support.
License
GPL v2 or later
Support
For bug reports and feature requests, please visit [your-support-url].
Author
Your Name - [your-website-url]