Version: 2.0.1
Author: Emmanuel Eluwa
GitHub: github.com/nueleluwa/Auto-Delete-Comments
WordPress Profile: profiles.wordpress.org/luwie93
License: GPL v2 or later
A modern, production-ready WordPress plugin that automatically deletes comments in batches with configurable scheduling, advanced analytics, REST API integration, and a professional admin interface.
- Code Quality: A+ (WordPress VIP Standards)
- Security: A+ (No vulnerabilities)
- Performance: Excellent (Optimized queries)
- Documentation: Comprehensive (10+ guides)
- Automatic Comment Deletion - Schedule batch deletions with WordPress cron
- Flexible Scheduling - Every 1-60 minutes with reliable cron system
- Selective Deletion - Choose comment types (spam, pending, approved, trash)
- Age Filtering - Delete only comments older than X days
- Batch Processing - 1-50 comments per run (prevents server errors)
- Activity Logging - Track last 100 deletion activities
- Manual Controls - Delete batch immediately with one click
- Real-Time Statistics - Live comment counts with auto-refresh
- Advanced Analytics - 30-day tracking with Chart.js visualizations
- REST API - Full API access for headless WordPress
- Modern Dashboard - Clean, WordPress-native design
- Author Section - Professional plugin branding
- Performance Optimized - Efficient queries and minimal resource usage
- Security Hardened - WordPress VIP coding standards compliant
- Fully Responsive - Mobile-first design
- Download the latest release
- Go to WordPress Admin β Plugins β Add New β Upload
- Choose the ZIP file
- Activate the plugin
- Extract the plugin folder
- Upload to
/wp-content/plugins/ - Activate via WordPress admin
Enable Auto Delete: OFF (configure first)
Batch Size: 15 comments
Interval: 5 minutes
Delete Types: Spam β | Trash β
Older Than: 0 days
- Go to Settings β Auto Delete Comments
- Review current comment statistics
- Configure your preferences
- Click "Delete Batch Now" to test
- Check deletion history
- Enable automatic deletion
The plugin features a modern, clean interface with:
- Real-time Statistics - Live comment counts by type
- Settings Panel - Easy configuration with toggle switches
- Status Sidebar - Current plugin status and next run time
- Analytics Chart - Visual 7-day deletion trend
- Activity Log - Last 100 deletion events with timestamps
- Author Section - Professional plugin branding
- Statistics Cards - Spam, Pending, Approved, Trash, Total counts
- Toggle Switch - Modern on/off control for plugin activation
- Settings Form - Batch size, interval, comment types, age filter
- Manual Actions - One-click "Delete Batch Now" button
- Deletion History - Table showing date, time, and count
- Author Card - Photo, bio, and social media links (GitHub, WordPress, Instagram)
| Setting | Range | Default | Description |
|---|---|---|---|
| Batch Size | 1-50 | 15 | Comments deleted per batch |
| Interval | 1-60 min | 5 | How often to run deletion |
| Comment Types | Multiple | Spam, Trash | Types to automatically delete |
| Older Than | 0+ days | 0 | Minimum age in days (0 = all) |
- Spam β (Safe) - Akismet/spam marked
- Trash β (Safe) - Already trashed
- Pending
β οΈ (Caution) - Awaiting moderation - Approved π¨ (Danger) - Real user comments
- Total Deleted - All-time comment deletions
- Average Per Run - Efficiency metric
- Total Runs - Execution count
- 7-Day Trend - Daily breakdown with interactive chart
- Comment Distribution - Real-time statistics by type
- Live Statistics - Auto-refresh every 30 seconds when enabled
- Line Chart - Visual deletion trends over 7 days
- Deletion History - Last 100 deletion activities with timestamps
- Manual Actions - One-click batch deletion for testing
- Status Panel - Current configuration and next scheduled run
GET /wp-json/auto-delete-comments/v1/statsResponse:
{
"spam": 42,
"pending": 5,
"approved": 1250,
"trash": 8,
"total": 1305
}GET /wp-json/auto-delete-comments/v1/analyticsResponse:
{
"total_deleted": 1234,
"avg_per_run": 15.2,
"total_runs": 81,
"last_7_days": {
"2024-11-06": 50,
"2024-11-07": 45,
"2024-11-08": 30,
...
}
}Requires manage_options capability. Use WordPress nonce for AJAX or standard authentication for REST API.
Goal: Keep spam under control automatically
Settings:
- Batch: 20 | Interval: 5 min | Types: Spam + Trash
Result: Deletes 20 spam comments every 5 minutes
Goal: Remove old spam without touching recent
Settings:
- Batch: 15 | Interval: 10 min | Types: Spam | Older: 30 days
Result: Deletes spam older than 30 days only
Goal: Periodic cleanup of all unwanted comments
Settings:
- Batch: 25 | Interval: 15 min | Types: Spam + Trash | Older: 7 days
Result: Weekly maintenance keeping database clean
- WordPress: 5.8 or higher
- PHP: 7.4 or higher
- MySQL: 5.6 or higher
- Optimized queries using
fields => 'ids' - Batch processing prevents timeouts
- Efficient cron scheduling
- No memory leaks
- Maximum 50 comments per batch (prevents URI errors)
- Nonce verification on all AJAX
- Capability checks (
manage_options) - Input sanitization with
absint() - Output escaping with
esc_html(),esc_attr() - No direct SQL queries
- WordPress Coding Standards compliant
- Singleton pattern
- REST API integration
- WordPress cron system
- Analytics tracking system
- Modular design
Critical Bug Fixes & Improvements
- Fixed: Template variable scope issues (
$this->usage in included files) - Fixed: Cron scheduling reliability (intervals now registered early)
- Fixed: Missing output escaping (XSS vulnerability eliminated)
- Added: Settings validation (prevents enabling without comment types) Added: Professional author section with photo and social links
- Added: Comprehensive error logging throughout
- Improved: WordPress-native design for author section
- Added: Extensive documentation (10+ guides)
- Added: Code quality validation script
Quality Improvements:
- A+ Security rating (all vulnerabilities fixed)
- A+ Code quality (WordPress VIP standards)
- Production-ready and fully tested
- 43 KB package with complete documentation
Major Update - Modern Interface
- Added real-time statistics dashboard
- Added advanced analytics with Chart.js
- Added REST API endpoints
- Added modern card-based UI design
- Added manual batch deletion controls
- Added 30-day analytics tracking
- Added activity logging (last 100 runs)
- Enhanced user interface
- Improved data visualization
- Comprehensive documentation
Security & Bug Fixes
- Fixed URI error by limiting batch size to 50
- Fixed cron scheduling bug
- Added comprehensive security measures
- 100% WordPress Coding Standards compliance
- Performance optimizations
- Better error handling
Initial Release
- Basic comment deletion functionality
- Configurable scheduling
- Comment type selection
- Activity logging
Contributions are welcome! Please follow these guidelines:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Follow WordPress Coding Standards
- Write clear commit messages
- Test thoroughly
- Submit a pull request
git clone https://github.com/nueleluwa/Auto-Delete-Comments.git
cd Auto-Delete-Comments
# Install dependencies if needed
# Run tests- FIXES.md - Technical details of all bug fixes
- CHANGELOG.md - Complete version history
- INSTALLATION-GUIDE.md - Detailed setup instructions
- QUICK-REFERENCE.md - Fast lookup guide
- SECURITY.md - Security policy and reporting
Found a bug? Open an issue on GitHub Issues
Need support?
- Check the documentation first
- Search existing GitHub issues
- Create a new issue with:
- WordPress version
- PHP version
- Plugin version
- Error messages (if any)
- Steps to reproduce
Have an idea? We'd love to hear it!
-
Open a GitHub Issue with the "enhancement" label
-
Describe the feature and use case
-
Explain how it would benefit users
This plugin is licensed under the GPL v2 or later.
Copyright (C) 2024 Emmanuel Eluwa
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.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
Emmanuel Eluwa is an accomplished Web Developer and WordPress Technical Support specialist with a decade of experience in the industry. He specializes in creating reliable, production-ready WordPress solutions.
- GitHub: github.com/nueleluwa
- WordPress: profiles.wordpress.org/luwie93
- Instagram: instagram.com/nueleluwa
- Website: Brela.agency
Emmanuel is the Co-Founder of Brela, a website support agency specializing in WordPress solutions for startups and businesses across Africa.
- WordPress Community
- Brela Team (initial development support)
- Chart.js for visualization library
- Contributors and testers
- GitHub Repository: github.com/nueleluwa/Auto-Delete-Comments
- Author GitHub: github.com/nueleluwa
- WordPress Profile: profiles.wordpress.org/luwie93
- License: GPL v2 or later
- Support: GitHub Issues
- Professional Services: Brela.agency
If this plugin helps you manage your WordPress comments, please consider:
- β Star the repository on GitHub
- π Share with the WordPress community
- π Report bugs to help improve the plugin
- π‘ Suggest features you'd like to see
- π€ Contribute code or documentation
- π¬ Review and provide feedback
Every bit of support helps make this plugin better for everyone!
Made with β€οΈ by Emmanuel Eluwa
WordPress Development | Technical Support | Plugin Development
GitHub β’ WordPress Profile β’ Brela
Auto Delete Comments v2.0.1
Licensed under GPL v2 or later
Β© 2024 Emmanuel Eluwa. All rights reserved.