All posts

Blog

How to Stop Spam Comments and Contact Form Spam with CAPTCHA and More

Illustrated cover for the Security & SSL guide "How to Stop Spam Comments and Contact Form Spam with CAPTCHA and More"

You add a contact form to your website, and within days it starts receiving messages. Unfortunately, most of them offer cheap SEO services, crypto schemes or links to sites you would never visit. Your blog comments fill up with "Great post!" followed by a suspicious URL.

Spam is one of the first problems almost every website runs into. It wastes your time, can bury real customer inquiries, and if spam links get published, it can harm your site's reputation with visitors and search engines. This guide covers how to stop spam comments and form submissions using CAPTCHA and other techniques, without making life hard for real visitors.

Why your site gets spammed

Most form spam comes from automated bots that crawl the web looking for forms to fill. They don't care how big your site is. They simply find a form field and submit. Some spam comes from humans paid to post links manually, which is harder to filter.

Spammers want:

  • Backlinks in comments to boost their own search rankings
  • Visibility for scams or products in your inbox
  • Email relay, abusing poorly configured forms that send messages to addresses the spammer supplies
  • Testing stolen credit cards on checkout or donation forms

The main tools for stopping spam

The most effective approach is layered. No single method catches everything, but combining a few stops the vast majority of spam.

Layer 1: CAPTCHA and bot challenges

A CAPTCHA is a test that's easy for humans and hard for bots. Modern versions are much less annoying than the distorted-text puzzles of the past.

Google reCAPTCHA

  • reCAPTCHA v2 ("I'm not a robot" checkbox): a checkbox that sometimes asks the user to pick images.
  • reCAPTCHA v2 Invisible: runs in the background and only shows a challenge when traffic looks suspicious.
  • reCAPTCHA v3: no challenge at all. It returns a score indicating how likely the visitor is a bot, and your site decides what to do with low scores.

reCAPTCHA is widely supported by form plugins. Check Google's current terms and pricing for your usage level, and mention it in your privacy policy because it processes visitor data.

hCaptcha

hCaptcha works similarly to reCAPTCHA v2, with checkbox and invisible modes, and is positioned as a privacy-focused alternative. Many plugins support it.

Cloudflare Turnstile

Turnstile is a CAPTCHA alternative that usually verifies visitors without any puzzle. It can be used even if your site isn't otherwise on Cloudflare, and many WordPress form plugins now support it.

Which should you choose?

  • If you want minimal friction, try an invisible option: Turnstile, reCAPTCHA v3 or invisible hCaptcha.
  • If spam keeps getting through, a visible checkbox challenge is stricter.
  • Whatever you choose, test that it works on mobile and with keyboard-only navigation, since some challenges create accessibility barriers.

Layer 2: Honeypot fields

A honeypot is a hidden form field that humans never see or fill in, but bots often do. If the hidden field contains data, the submission is discarded.

Honeypots are invisible to real users and add zero friction. Many form plugins include a honeypot option, sometimes turned on by default. They won't stop sophisticated bots, but they catch a surprising amount of simple spam.

Layer 3: Anti-spam filtering services

Filtering services analyze the content of each submission and compare it with patterns seen across many sites.

  • Akismet is the best-known option for WordPress comments and integrates with many contact form plugins. Its pricing depends on site type, so check its current terms.
  • Several other WordPress anti-spam plugins work without external services, using techniques such as time checks and JavaScript validation.

Layer 4: Smart form settings

Small configuration changes make a big difference.

For contact forms

  • Never let visitors choose the recipient address. Forms should send only to addresses you set.
  • Use a time check. Bots often submit forms within a second or two of loading the page, faster than any human could type.
  • Limit links in message fields, or flag messages containing several URLs.
  • Validate inputs, such as proper email format or a phone number field that only accepts numbers.
  • Send through authenticated SMTP rather than PHP mail where possible, so legitimate form notifications reliably reach your inbox. See why emails go to spam for deliverability background.

For WordPress comments

Under Settings > Discussion, you can:

  • Require comment authors to have a previously approved comment, or hold all comments for moderation
  • Hold comments containing more than a set number of links
  • Add words, URLs or IPs to the moderation or disallowed lists
  • Automatically close comments on older posts
  • Require users to be registered and logged in to comment

If you don't need comments at all, turn them off entirely. That's the most effective spam filter there is.

Layer 5: Server and firewall protection

A web application firewall can block known spam bots and rate-limit submissions before they reach your forms. Server-level protections and security plugins can also block abusive IP addresses. These tools are especially helpful during spam floods that strain your server.

Keep spam links from hurting your site

If spam slips through and gets published:

  • Delete it promptly. Don't let it sit on public pages.
  • WordPress adds rel="nofollow" to links in comments by default, and Google also supports rel="ugc" for user-generated content. These hint to search engines that you don't vouch for those links.
  • Check older posts. Spam often accumulates on popular articles.

Dealing with registration spam

If your site allows user registrations, spammers may create fake accounts. In WordPress, if you don't need public registration, uncheck Anyone can register under Settings > General. If you do need it, add a CAPTCHA to the registration form and consider email verification.

A balanced setup for most small sites

For a typical small business site or blog, this combination works well:

  1. A honeypot on every form
  2. An invisible bot challenge such as Turnstile, reCAPTCHA v3 or invisible hCaptcha
  3. A content filter like Akismet for comments, if you allow them
  4. Sensible comment moderation settings
  5. A firewall at the server or cloud level

Start light, monitor what gets through for a couple of weeks, and tighten only if needed. Overly aggressive spam protection can block real customers, which costs more than a few spam messages.

Wrapping up

Spam is unavoidable, but drowning in it isn't. Layer a honeypot, a modern low-friction CAPTCHA, content filtering and sensible form and comment settings, and most spam disappears before you ever see it. Review your setup now and then, and make sure your defenses stop bots without shutting out the people you built the site for.