SpamAnvil

plugin banner

Stop comment spam with AI. Uses ChatGPT, Claude, Gemini and other LLMs to catch spam that traditional filters miss. 100% free.

Author:Alexandre Amato (profile at wordpress.org)
WordPress version required:5.8
WordPress version tested:6.9.1
Plugin version:1.2.7
Added to WordPress repository:14-02-2026
Last updated:22-02-2026
Rating, %:0
Rated by:0
Plugin URI:https://software.amato.com.br/spamanvil-antis...
Total downloads:419
Active installs:20+
plugin download
Click to start download

SpamAnvil is a free, open-source WordPress anti-spam plugin that uses artificial intelligence to block comment spam. Unlike Akismet (which requires a paid plan for commercial sites) or simple keyword-based filters, SpamAnvil leverages large language models (LLMs) to actually understand your comments and detect even the most sophisticated spam.

Traditional spam filters rely on static word lists and link counting. Spammers have evolved. SpamAnvil fights back with AI that understands context, intent, and language patterns – catching spam that looks legitimate and approving real comments that others would flag.

Why SpamAnvil?

  • 100% Free – No premium tier, no subscription, no hidden costs. Bring your own API key (free options available).
  • Smarter Than Rules – AI understands context. A comment about “buying a new home” won’t be flagged just because it contains “buy”.
  • Works With Free AI Models – Use OpenRouter’s free Llama models for $0 cost, or connect premium models for maximum accuracy.
  • Privacy-First – Your data stays between you and your chosen AI provider. IP addresses are stored as irreversible SHA-256 hashes. GDPR/LGPD compliant by design.
  • No Cloud Lock-in – Choose from 6+ AI providers. Switch anytime. Your anti-spam, your rules.

Supported AI Providers

  • OpenAI (GPT-4o-mini, GPT-4o, etc.)
  • Anthropic Claude (Claude Sonnet, Haiku, etc.)
  • Google Gemini (Gemini 2.0 Flash, Pro, etc.)
  • OpenRouter (100+ models, including FREE ones)
  • Featherless.ai (Open-source models)
  • Any OpenAI-compatible API (LM Studio, Ollama via proxy, vLLM, etc.)

Key Features

  • AI-Powered Spam Detection – Each comment is analyzed by an LLM that scores it 0-100 for spam probability
  • Intelligent Heuristics Engine – Pre-analyzes comments with regex patterns, spam word detection, URL counting, and prompt injection detection to catch obvious spam without API calls
  • Async Background Processing – Comments are queued and processed via WP-Cron so your site stays fast
  • Smart IP Blocking – Automatically blocks repeat offenders with escalating ban durations (24h, 48h, 96h…)
  • Automatic Retry with Backoff – Failed API calls retry up to 3 times with exponential delays
  • Encrypted API Key Storage – AES-256-CBC encryption for all stored API keys. Optional wp-config.php constants for maximum security
  • Statistics Dashboard – Track how many comments were checked, how much spam was caught, API usage and errors
  • Full Evaluation Logs – See the AI’s reasoning for every comment scored, with provider, model, response time, and score
  • Customizable AI Prompts – Full control over what the AI is instructed to do
  • Fallback Provider – Configure a backup AI so spam checking never stops
  • Prompt Injection Defense – Multi-layered protection prevents attackers from manipulating the AI through crafted comments
  • Configurable Spam Threshold – Slide between aggressive (catch more spam) and permissive (fewer false positives)
  • Moderator Bypass – Trusted users skip spam checking entirely

How It Works

  1. A visitor submits a comment
  2. SpamAnvil checks if the IP is blocked from previous spam attempts
  3. The heuristic engine runs a quick pre-analysis (URL count, spam words, suspicious patterns)
  4. If the heuristic score is very high, the comment is instantly marked as spam – no API call needed
  5. Otherwise, the comment is queued for AI analysis (or processed immediately in sync mode)
  6. The AI analyzes the comment in context (post title, author info, heuristic data) and returns a spam score
  7. Comments scoring above your threshold are marked as spam; clean comments are auto-approved
  8. Repeat offender IPs are automatically blocked with escalating durations

Use Cases

  • Blogs receiving hundreds of spam comments per day
  • WooCommerce stores where comment spam affects SEO and credibility
  • Membership sites that need to protect community discussions
  • Multilingual sites – AI understands comments in any language, unlike keyword-based filters
  • High-traffic sites – Async processing handles any volume without slowing down your site
  • Sites tired of Akismet – Free alternative with no cloud dependency and full data control

Security

SpamAnvil follows WordPress security best practices throughout:

  • AES-256-CBC encrypted API key storage
  • wp-config.php constant support for API keys (never touch the database)
  • Nonce verification on all forms and AJAX requests
  • Capability checks on all admin actions
  • Prepared SQL statements on every database query
  • Output escaping on all rendered content
  • Prompt injection defense: boundary tags, system prompt hardening, heuristic injection detection, strict JSON validation, temperature 0

Languages

  • English (default)
  • Translation-ready (.pot file included)

Third-Party Services

SpamAnvil sends comment data (content, author name, email, and URL) to external AI services for spam analysis. The specific service used depends on your configuration. No data is sent until you configure and enable a provider.

When using the “Generic OpenAI-Compatible” option, data is sent to the URL you configure. You are responsible for ensuring compliance with the privacy policies of your chosen service.


FAQ
ChangeLog