π€ AI-powered comment moderation for WordPress - Protect your WordPress site from spam with intelligent, customizable AI analysis.
- π Multiple AI Providers: OpenAI (GPT-4/GPT-3.5), Anthropic (Claude), OpenRouter
- β‘ Automatic Processing: Real-time comment analysis and moderation
- π― Smart Classification: Auto-approve, reject, hold, or mark as spam
- π Confidence Thresholds: Customizable confidence levels for actions
- βοΈ Custom Prompts: Tailor AI behavior to your needs
- π Comprehensive Logging: Track all decisions with detailed statistics
- π Secure Integration: Encrypted API key storage
- π i18n Ready: Fully translatable
- βοΈ Easy Setup: Intuitive admin interface
- WordPress 5.0+
- PHP 7.2+
- API key from supported provider
- SSL certificate (recommended)
- Navigate to Plugins > Add New
- Search for "AI Comment Guard"
- Click Install Now then Activate
- Go to Settings > AI Comment Guard
- Download the latest release
- Upload to
/wp-content/plugins/ai-comment-guard/ - Activate through the Plugins menu
- Configure at Settings > AI Comment Guard
- Choose Provider: Select OpenAI, Anthropic, or OpenRouter
- Add API Key: Enter your provider's API key
- Test Connection: Verify the connection works
- Set Thresholds: Configure confidence levels
- Customize Prompts: Tailor AI analysis criteria
- Enable Logging: Track moderation decisions (optional)
- Get your key at platform.openai.com
- Supports GPT-4 and GPT-3.5 models
- Excellent for nuanced content analysis
- Get your key at console.anthropic.com
- Uses Claude models
- Great for context-aware moderation
- Get your key at openrouter.ai
- Access to multiple AI models
- Flexible pricing options
// The plugin works automatically once configured
// Comments are processed before being saved to database- Spam Threshold: 0.7 (70% confidence = mark as spam)
- Approval Threshold: 0.3 (30% confidence = auto-approve)
- Between thresholds: Hold for manual review
Analyze this comment for spam, inappropriate content, or legitimate discussion.
Consider: relevance, tone, promotional content, and value to discussion.
Respond with JSON: {"analysis": "approved|rejected|spam", "confidence": 0.0-1.0, "reason": "explanation"}
- Nonce Verification: All AJAX requests protected
- Capability Checks: Admin-only access to settings
- Data Sanitization: All inputs properly sanitized
- SQL Injection Protection: Prepared statements used
- XSS Prevention: Output properly escaped
- HTTPS Only: API communications encrypted
The plugin is fully translatable with .pot file included. Available text domains:
ai-comment-guard
To translate:
- Use the included
.potfile - Create your
.poand.mofiles - Place in
/wp-content/languages/plugins/
- Async Processing: Non-blocking comment analysis
- Database Indexes: Optimized query performance
- Caching: Configuration cached for efficiency
- Cleanup Cron: Automatic old log removal
- Minimal Overhead: < 50ms average processing time
ai-comment-guard/
βββ admin/ # Admin interface assets
β βββ css/ # Admin styles
β βββ js/ # Admin scripts
βββ includes/ # Core PHP classes
β βββ AI/ # AI provider implementations
β βββ Admin/ # Admin functionality
β βββ Comments/ # Comment processing
β βββ Core/ # Core plugin files
β βββ Database/ # Database operations
β βββ Utils/ # Utility classes
βββ languages/ # Translation files
βββ ai-comment-guard.php # Main plugin file
βββ readme.txt # WordPress.org readme
βββ README.md # This file
βββ uninstall.php # Clean uninstall handler
- PSR-4 Autoloading: Modern PHP namespace structure
- WordPress Coding Standards: Following WP guidelines
- PHPDoc Comments: Complete documentation
- Security Best Practices: OWASP guidelines followed
- Design Patterns: Singleton, Factory, Strategy patterns
// Filter comment approval status
add_filter('pre_comment_approved', 'your_function', 10, 2);
// Action after AI analysis
do_action('aicog_after_analysis', $comment_data, $analysis);
// Filter AI prompt
add_filter('aicog_prompt', 'customize_prompt', 10, 2);- Install and activate plugin
- Configure API provider
- Test connection
- Submit test comment
- Verify AI analysis
- Check logs (if enabled)
- Test threshold adjustments
- Verify uninstall cleanup
For detailed version history and release notes, see the changelog in readme.txt or visit the WordPress.org plugin page.
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Open a pull request
Please report issues with:
- WordPress version
- PHP version
- Error messages
- Steps to reproduce
AI Comment Guard is licensed under GPL v2 or later.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
Tudor Constantin
- LinkedIn: tudor-eusebiu-constantin
- WordPress Community for feedback and support
- Contributors and testers
- AI provider teams for excellent APIs
For support, please:
- Check the FAQ section
- Visit the support forum
- Contact via LinkedIn
β If you find this plugin useful, please consider leaving a 5-star review on WordPress.org!