Skip to content

How to Stop Spam in WordPress: Comments, Forms and Email

How to stop spam in WordPress starts with one question: which door is open. Most sites get hit through comments, then through forms, and only then through email. The order matters, because each door needs a different answer and a plugin that only filters comments leaves the other two open.

Spam is cheap to send and expensive to read. On a busy blog the moderation queue fills overnight, and the first thing the owner does in the morning is delete twenty comments about loans. That work costs nothing to the sender and everything to the site.

Where spam enters a WordPress site

Three paths carry almost all of it. Comments on posts and pages are the oldest and still the busiest. Forms come second: registration, contact, checkout and any plugin that accepts a message. Email is the third: WordPress sends notifications, password resets and order emails, and a form that lets anyone set the recipient turns the site into a relay.

There is a fourth path that gets less attention. A bot that never posts anything still costs requests, and a thousand requests per minute from one subnet is a load problem before it is a content problem. That traffic belongs to the firewall layer, not to the comment filter.

Spam comments: close the easy path

WordPress ships with moderation tools that most sites never tune. Discussion settings let you hold a comment until an administrator approves it, close comments on old posts, and require a name and email. Turning those on costs nothing and removes the simplest bots, which post directly to the comment endpoint without reading the page.

The endpoint is the part people forget. A script can send a comment to wp-comments-post.php without loading the form at all, so a honeypot field in the template stops only the lazy ones. The plugin checks the request itself: headers, rate, and the reputation of the address.

A CAPTCHA on the form helps, and the choice of mode matters more than the brand. A button is enough for comments and cheap for a person. Picture tasks slow readers and are worth keeping for forms that get real abuse. BotBlocker ships eight modes, so a comment form and a checkout do not need the same one.

Forms: registration, contact and checkout

Registration forms attract bots that want a link, a profile or a mailbox. Contact forms attract messages with links in the body. Checkout forms attract card testing, and that one costs money: each attempt is a real authorization request against the payment provider.

The counter belongs on the server. Rate limiting of thirty requests per minute brings the CAPTCHA, fifty brings the ban, and the numbers are a setting rather than a constant. For a contact form the limit can be lower, because a person rarely sends three messages in a minute.

Spam that passes every check is usually typed by a person. No filter separates a paid poster from a customer, and that case is handled by moderation rules and account limits, not by a stronger CAPTCHA.

Email: the part a plugin cannot fix alone

WordPress sends mail through the server, and a shared host treats that mail as suspicious by default. Messages land in spam or disappear because the server has no reputation. The fix sits outside the plugin: an SMTP provider with a signed domain, SPF, DKIM and DMARC records.

What the plugin can do is stop the site from being used as a sender. When a form has no rate limit and no address check, a script fills the recipient field and the server sends the mail. Reading the event log is how you notice it: a burst of form submissions from one subnet at three in the morning is visible before the first complaint arrives.

What the firewall sees before WordPress

A security plugin that starts inside WordPress has already paid for the request: PHP, the database, the theme. BotBlocker starts from wp-config.php and as an MU-plugin, so the decision happens before WordPress loads. A blocked request costs almost nothing, which is why a flood during a comment spam wave does not take the site down.

The checks are the same ones the log uses for everything else: 13 header checks, PTR, ASN, GeoIP and the 5M+ signature base. A comment bot and a scraper look alike at this layer, and both are answered before a database query runs.

A short checklist

  1. Turn on comment moderation and close comments on posts older than a month.
  2. Add a CAPTCHA to comments, registration and the contact form, one mode per form.
  3. Set a rate limit per address and per subnet.
  4. Put an SMTP provider in front of WordPress mail and sign the domain.
  5. Read the event log once a week and look for bursts, not single events.

None of these steps needs a developer. The order matters more than the tool, and the first two remove most of the noise within a day.

Questions we hear

Does a CAPTCHA stop spam completely?

No. It raises the cost for a script and leaves a person who types by hand. Against a paid poster the answer is moderation and account limits, not a harder puzzle.

Will blocking spam comments hurt SEO?

Removing spam comments helps. Google has ignored comment links for years, and a page full of unrelated text reads worse to a person than to a crawler.

Do I need a separate anti spam plugin?

BotBlocker covers comments, registration, forms and the firewall in one place, and the free tier includes the comment side. A second plugin adds another set of rules to debug when a real comment disappears.

Where do I see what was blocked?

The event log keeps the rule that fired, the address and the path, with 55 event codes in 12 categories. Start with the bans, then read the addresses that returned.

Next step

Turn on comment moderation today, then add a CAPTCHA and a rate limit to the forms that accept messages. The free anti spam plugin page lists what the free tier blocks, the brute force protection page covers the login side, and the prices name the tier. WordPress documents its own moderation switches in the discussion settings guide.