WP Manifestindependent plugin directory
manifest / unclassified / wordpress-antispam

Custom AntiSpam for WordPress

Experimental WordPress antispam plugin; work in progress.

by Your Name · github.com/akrmba/wordpress-antispam · website

★ 0stars
0forks

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/akrmba/wordpress-antispam/archive/refs/heads/main.zip

A comprehensive WordPress plugin for advanced spam filtering with customizable blocked words management. Compatible with Newspaper 12 theme and all WordPress themes that use the standard comment system.

Features

📝 Comprehensive Word Management

  • Exact Match Words: Block complete words only (case-insensitive)
  • Partial Match Words: Block words containing specific patterns
  • Safe Words (Whitelist): Never block these words, even if they match other rules
  • One word per line format: Easy to read and edit

🚀 Smart Functionality

  • Common Spam Words: Pre-fill with typical spam keywords
  • Test Word Feature: Check if words would be blocked
  • Import/Export: Plain text file support for word lists
  • Word Count Display: See how many words are in each list
  • Reset to Default: Easily restore original settings

🔧 User-Friendly Interface

  • Clean, modern WordPress admin interface
  • Tabbed organization for different word types
  • Real-time word counting
  • Visual feedback for all actions

🔒 Advanced Protection

  • Automatic comment filtering on WordPress sites
  • Visual spam indicators in admin
  • Statistics tracking (spam blocked, texts checked)
  • Activity logging with detailed reports

💾 Backup & Recovery

  • Complete Backup System: Export all lists as JSON
  • Import from Backup: Restore from previous backups
  • Foolproof Recovery: Never lose your settings

🎨 Theme Compatibility

  • Newspaper 12 Theme: Fully compatible
  • All WordPress Themes: Works with any theme using standard comment system
  • Custom Post Types: Filters comments on all post types

Installation

Method 1: Manual Installation

  1. Download the plugin files to your computer
  2. Upload to WordPress:
    • Go to your WordPress admin → Plugins → Add New → Upload Plugin
    • Choose the plugin zip file and click "Install Now"
    • Activate the plugin

Method 2: FTP Installation

  1. Extract the plugin files to a folder named custom-antispam-wordpress
  2. Upload via FTP:
    • Connect to your server via FTP
    • Navigate to /wp-content/plugins/
    • Upload the custom-antispam-wordpress folder
  3. Activate the plugin in WordPress admin → Plugins

Method 3: Direct File Upload

  1. Upload files directly to /wp-content/plugins/custom-antispam-wordpress/
  2. Activate the plugin in WordPress admin

Configuration

Initial Setup

  1. Activate the plugin following the installation steps above
  2. Access settings: Go to WordPress admin → AntiSpam (in the left menu)
  3. Configure general settings on the main dashboard
  4. Manage word lists: Click "Word Lists" to configure your filtering rules

Managing Word Lists

Exact Match Words

  • Enter words that should be blocked only when they appear as complete words
  • Example: "spam" will block "spam" but not "antispam"

Partial Match Words

  • Enter patterns that should be blocked if they appear anywhere within words
  • Example: "viagra" will block "viagra", "v1agra", "buyviagra", etc.

Safe Words (Whitelist)

  • Enter words that should never be blocked
  • These override both exact and partial match rules
  • Useful for legitimate words that might trigger false positives

Using the Features

Adding Common Spam Words

  1. Go to AntiSpam → Word Lists
  2. Click "Add Common Spam Words" button for any list
  3. Predefined spam keywords will be added to your list

Testing Words

  1. Go to AntiSpam → Test Filter
  2. Enter text you want to test
  3. Click "Test Text" to see what would be blocked

Import/Export Word Lists

  • Import: Click "Import List" and select a .txt file (one word per line)
  • Export: Click "Export List" to download your current list

Backup & Restore

  • Backup All Lists: Creates a complete JSON backup of all your settings
  • Restore From Backup: Import a previously created backup file

Admin Interface

Main Dashboard

  • Statistics Overview: See spam blocking statistics at a glance
  • General Settings: Configure plugin behavior and sensitivity
  • Quick Actions: Easy access to word management and testing
  • Theme Compatibility Info: Details about Newspaper 12 and other themes

Word Lists Management

  • Three separate sections for exact, partial, and safe words
  • Real-time word counting for each list
  • Common word buttons for quick setup
  • Reset to default functionality
  • Import/Export capabilities

Test Filter

  • Live testing of text against current word lists
  • Word-by-word analysis showing what would be blocked
  • Sample test cases for quick testing
  • Current settings overview

Activity Log

  • Detailed statistics of spam blocking activity
  • Most blocked words analysis
  • Pagination for large log files
  • Bulk actions for log management
  • Export capabilities

Configuration Examples

Basic Setup

Exact Words: spam, scam, lottery, prize
Partial Words: viagra, cialis, pills
Safe Words: the, and, hello, thanks

Advanced Setup

Exact Words: 
- Financial scams: loan, debt, mortgage, refinance
- Gambling: casino, lottery, jackpot, winnings
- Urgency: urgent, immediate, expires, limited

Partial Words:
- Medical spam: pill, drug, prescription, enhancement
- Marketing: amazing, incredible, revolutionary, breakthrough

Safe Words:
- Common words: the, and, or, but, in, on, at
- Polite words: please, thanks, hello, sorry

Settings Options

General Settings

  • Enable AntiSpam Protection: Turn filtering on/off
  • Action for Spam Comments: Choose how to handle spam
    • Hold for Moderation (recommended)
    • Mark as Spam
    • Delete Immediately
  • Sensitivity Level: Low, Medium, or High
  • Whitelist Registered Users: Skip checking for logged-in users
  • Log Activity: Track spam attempts for analysis
  • Notification Email: Email for spam notifications

Block Actions

  • Hold for Moderation: Comments are held for admin review
  • Mark as Spam: Comments are automatically marked as spam
  • Delete Immediately: Comments are deleted without notification

Theme Compatibility

Newspaper 12 Theme

The plugin is fully compatible with Newspaper 12 theme and will filter comments in:

  • Article comments
  • Page comments
  • Custom post type comments
  • Any other comment areas using WordPress comment system

Other Themes

Works with any WordPress theme that uses the standard WordPress comment system:

  • Twenty Twenty-Four
  • Astra
  • Divi
  • Elementor themes
  • Custom themes

Database Structure

The plugin creates two database tables:

wp_custom_antispam_words

  • Stores word lists (exact, partial, safe)
  • Includes timestamps for tracking

wp_custom_antispam_logs

  • Stores spam blocking activity
  • Tracks IP addresses, user agents, and match details

File Structure

custom-antispam-wordpress/
├── custom-antispam-wordpress.php    # Main plugin file
├── includes/
│   ├── admin-main.php               # Main dashboard
│   ├── admin-words.php              # Word management
│   ├── admin-test.php               # Test filter
│   └── admin-logs.php               # Activity logs
├── assets/
│   ├── admin.css                    # Admin styling
│   └── admin.js                     # Admin JavaScript
└── README.md                        # This file

Tips for Best Results

  1. Start Small: Begin with a few obvious spam words and expand gradually
  2. Test Regularly: Use the test feature to avoid blocking legitimate content
  3. Use Safe Words: Add common legitimate words to prevent false positives
  4. Regular Backups: Export your settings periodically
  5. Monitor Stats: Check the statistics to see how effective your filtering is
  6. Review Logs: Regularly check the activity log for patterns

Troubleshooting

Plugin Not Working

  • Ensure it's enabled in the plugins page
  • Check that the toggle in settings is set to "on"
  • Verify WordPress comment system is active

False Positives

  • Add legitimate words to the Safe Words list
  • Review your Partial Match words for overly broad patterns
  • Use the Test feature to verify your settings

Missing Features

  • Make sure you're using the latest version
  • Clear WordPress cache and reload
  • Check browser console for error messages

Database Issues

  • Deactivate and reactivate the plugin
  • Check WordPress database permissions
  • Verify table creation in database

Privacy & Security

  • No Data Collection: All word lists are stored locally in your WordPress database
  • No Network Requests: The plugin works entirely offline
  • No Tracking: No usage statistics are sent anywhere
  • Local Storage Only: Uses WordPress database for all storage
  • Secure: Follows WordPress security best practices

Performance

  • Lightweight: Minimal impact on site performance
  • Efficient: Optimized database queries
  • Caching: Uses WordPress caching when available
  • Scalable: Handles large word lists efficiently

Support

If you encounter issues or have suggestions:

  1. Check the WordPress debug log for error messages
  2. Try disabling and re-enabling the plugin
  3. Clear WordPress cache and reload
  4. Check database permissions and table creation
  5. Review the activity log for clues

Version History

  • v1.0.0: Initial release with full word management system
    • Complete admin interface
    • Database integration
    • Import/Export functionality
    • Test filter
    • Activity logging
    • Newspaper 12 compatibility

Requirements

  • WordPress: 5.0 or higher
  • PHP: 7.4 or higher
  • MySQL: 5.6 or higher
  • Browser: Modern browsers with JavaScript enabled

License

This plugin is licensed under the GPL v2 or later.

Credits

Developed for WordPress with compatibility for Newspaper 12 theme and all standard WordPress themes.


Made with ❤️ for a spam-free WordPress experience