WordPress

Stop comment and form spam on WordPress

Reduce WordPress comment and contact form spam: discussion settings, moderation rules, anti-spam plugins, honeypots and CAPTCHA, and cleaning up existing spam.

BeginnercPanel hosting3 min read

Spam bots find every WordPress site sooner or later and fill comments and contact forms with links. Besides the annoyance, thousands of spam comments bloat the database and slow down the dashboard. A few settings and one good plugin stop almost all of it.

Before you start

  • Decide whether you need comments at all. Many business sites do not, and switching them off removes the problem completely.
  • Administrator access to WordPress.

Turn off comments where you do not need them

  1. Go to Settings → Discussion.
  2. Untick Allow people to submit comments on new posts.
  3. Untick Allow link notifications from other blogs (pingbacks and trackbacks).
  4. For existing posts, go to Posts → All Posts, select all, choose Bulk actions → Edit and set Comments to Do not allow.

Tighten discussion settings

If you keep comments, these settings in Settings → Discussion help:

SettingRecommended
Users must be registered and logged in to commentFor communities; stops nearly all bots
Automatically close comments on posts older than30 to 90 days
Comment must be manually approvedOn for small sites
Comment author must have a previously approved commentOn
Hold a comment in the queue if it contains2 or more links
Disallowed Comment KeysCommon spam words and domains

Install an anti-spam plugin

  • Akismet: checks comments against a large spam database; needs an API key (free for personal sites).
  • Antispam Bee: free, works locally without sending data to an external service, good for privacy-focused sites.
  • Use only one comment anti-spam plugin to avoid conflicts.

Protect contact forms

  • Enable the honeypot field in your form plugin (Contact Form 7, WPForms, Fluent Forms and others have one). It is invisible to people but bots fill it in.
  • Add a CAPTCHA if spam continues: Cloudflare Turnstile, hCaptcha or Google reCAPTCHA. Turnstile and invisible reCAPTCHA do not annoy real visitors.
  • Do not show your raw email address on the page; let the form send it.

Clean up existing spam

  1. Go to Comments → Spam and click Empty Spam.
  2. Check Comments → Pending, select obvious spam and choose Bulk actions → Mark as spam.
  3. For tens of thousands of comments, use WP-CLI: wp comment delete $(wp comment list --status=spam --format=ids) --force.
  4. Optimise the database afterwards with LiteSpeed Cache → Database → DB Optimizer.

Registration spam

If fake user accounts appear, check Settings → General → Membership. Untick Anyone can register unless you need public registration, and make sure New User Default Role is Subscriber, never Administrator.

Troubleshooting

  • Real comments end up in spam: check the spam folder weekly and click Not Spam; the plugin learns from it.
  • Spam keeps arriving with comments off: bots post directly to wp-comments-post.php. A comment-disabling plugin or a rule blocking that file stops it.
  • Form notifications missing after adding CAPTCHA: the CAPTCHA keys are wrong or the domain is not registered with the provider.

Next steps

Was this guide helpful?

Still stuck?

Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.