• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
NameHero® Blog

NameHero® Blog

Web Hosting Tips & Resources From NameHero

  • AI Agents
    • OpenClaw
    • Claude Code
    • n8n
    • Hermes Agent
    • Open WebUI
    • Docker
  • Hosting
    • Web Hosting
    • WordPress Hosting
    • WooCommerce Hosting
    • Enterprise Hosting
    • Email Hosting
    • HeroicGuard
    • GPU Hosting
    • Website Builder
  • VPS
    • Managed VPS
    • Unmanaged VPS
    • Flex VPS
  • Reseller
  • Gaming
  • Domains
  • Account
  • Blog Home
  • Categories
  • Authors

How To Block Spam Comments In WordPress

Bhagwad Park

Published on: September 5, 2018

Categories: WordPress 0

I’ve struggled with spam comments for years on my personal blog. When I first started blogging in 2006, I’d wake up in the morning with a ton of spam messages that had slipped through traditional spam solutions like Akismet. The useless traffic was killing my site speed, and I had to implement all kinds of complicated solutions to stay relatively free of bots.

That was over 10 years ago, and things have changed. Google got into the game!

These days, Akismet is still around and still enabled by default on WordPress blogs around the world. And it still picks up a lot of stuff. But I don’t know of any large site that relies solely on Akismet. Instead, these days we have Google’s reCAPTCHA which has slowly been upping its game and is now a pretty comprehensive solution to block spam on WordPress.

Here’s how to go about it.

Using Google’s Invisible reCAPTCHA

The Google’s invisible reCAPTCHA solution was introduced by Google in 2017. It’s a small script that stays in the background and monitors all kinds of stats that distinguish a human visitor from a bot. We don’t know exactly what these parameters are, but we can guess it includes:

  1. Mouse movement
  2. Typing speeds
  3. Scroll speeds
  4. ..

The captcha uses machine learning to identify patterns of bot behavior and modify its algorithm in real time to respond to changing threats. It’s pretty cool!

Step 1: Register a Site for Use with reCAPTCHA

To use this cool new solution, first sign up for a reCAPTCH account by visiting https://www.google.com/recaptcha/admin. Here, scroll down and fill out the form below like this:

Register for reCaptcha

Give your site a recognizable label and select the second radio button labeled “Invisible reCAPTCHA”. In the “Domains” box below, enter the name of each domain that you want to protect using it. One on every line. Entering the name of a domain also means that it protects subdomains.

Accept the reCAPTCHA terms of service and go to the next page.

Step 2: Saving your Site Key and Secret Key

When you register your site properties in step 1, Google creates two separate string of characters:

  1. Site Key
  2. Secret Key

The site key is public knowledge. The secret key is meant to be…secret! The latter is only used between you and Google:

Site Key and Secret Key

Make a note of these keys. We’ll be using them in in the next step.

Step 3: Installing and Configuring the Invisible reCAPTCHA Plugin

You can install the invisible reCAPTCHA code manually and integrate it into your comment form, but it’s too much of a hassle for me. I’d much rather use a plugin instead. Here, my choice goes to Invisible reCaptcha for WordPress by Mihai Chelaru.

After installing and activating the plugin, go to the Settings page under Settings -> Invisible reCAPTCHA. Here, enter your site key and secret key as shown here:

Insert Site key and Secret key

Save your changes. Next, select “WordPress” on the left-hand side and enable the checkbox labeled “Enable Comments Form Protection” like this:

Enable Protection on Comment Forms

Save your changes. Now visit your site anonymously and go to any post with a comment form. You should see this at the bottom:

reCAPTCHA to block spam comments

This means that your site is not protected by the invisible reCAPTCHA. Bots beware!

Alternative Solution – Use Disqus Instead

Another option is to just do an end run around the entire process and use a 3rd party comment system like Disqus instead. They’ll do all your spam filtering for you. But of course, it has disadvantages like:

  1. Can’t theme Disqus to match your site
  2. Can’t have your own login procedure
  3. Less of a community as users can’t leave their site in the URL
  4. It adds a lot of extra code to your site, even though it can load asynchronously

On the other hand, it can handle an infinite number of comments and you’ll never have to deal with spam load again since posting comments doesn’t reload the page anyway. You’ll have to decide for yourself if the tradeoffs are worth it.

Bhagwad Park Profile Picture
Bhagwad Park

I’m a NameHero team member, and an expert on WordPress and web hosting. I’ve been in this industry since 2008. I’ve also developed apps on Android and have written extensive tutorials on managing Linux servers. You can contact me on my website WP-Tweaks.com!

Related Posts

Joomla vs. WordPress: Which One Is Better?

In this post, we’ll consider five differences between Joomla and WordPress and how you might go forward with setting up a WordPress website.

What Is Self-Hosted WordPress?

In this post, we’ll differentiate self-hosted WordPress from WordPress.com, and discuss the benefits of the former.

How to Eliminate Render-Blocking Resources in WordPress (& Why You Should)

Many things can slow down your site, including render-blocking resources. These are CSS and JavaScript files that delay the loading of content on your site. As a result, visitors will have to wait longer to interact with your page, which could lead to frustration and instant exits.  So, what can you do to eliminate render-blocking […]

How To Back Up Your WordPress Site (And Why You Should Do It Today)

In this post, we’ll take a closer look at why backups matter. We’ll also show you different ways to back up your WordPress website.

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Follow & Subscribe

Exclusive promos, content and more!


Most Popular Posts

NameHero’s Recommended WordPress Plugin and Theme Setup

WordPress Hosting vs. Web Hosting – What’s The Difference?

How To Increase The InnoDB Buffer Pool Size

How To Fix A Stuck All-in-One WP Migration Import

How To Add A Subdomain In Cloudflare

Top Categories

  • WordPress
  • WordPress Tutorials
  • OpenClaw Hosting
  • Enterprise Hosting
  • WooCommerce
  • Web Hosting
  • Resellers
  • Website Security
  • Website Development
  • Website Performance
  • VPS Hosting
  • SEO Tips
  • Announcements
  • Domain Registration
NameHero

NameHero® proudly provides web hosting to over 40,000 customers with 99.9% uptime to over 750,000 websites.

  • Master Card
  • Visa
  • American Express
  • Discover
  • Paypal
Products
  • Web Hosting
  • Managed VPS Hosting
  • Unmanaged VPS Hosting
  • Flex VPS Hosting
  • WordPress Hosting
  • WooCommerce Hosting
  • Reseller Hosting
  • Enterprise Hosting
  • GPU Hosting
  • Email Hosting
  • HeroicGuard
  • Domains
  • Website Builder
  • AI Agent Hosting
Help & Support
  • NameHero Blog
  • NameHero Gaming Blog
  • Support
  • Help Center
  • Migrations
  • Affiliates
  • Gaming Affiliates
  • Call 1-855-984-6263
Company
  • About Us
  • Contact Sales
  • Reviews
  • Uptime
  • We're Hiring

Copyright © 2026 Name Hero, LLC. All rights reserved.
NameHero® is a registered trademark.

  • Privacy Policy
  • Terms of Use
  • Acceptable Use Policy
  • Payment Policy
  • DMCA