Ban IP to Stop WordPress Comment Spam Forever

WordPress spam comments is a big problem, but how can we stop, ban, block spam comments before they hit our WordPress blogs. A simple plugin can ban IP addresses of spammers and significantly reduce spam comments on your blog.

WordPress Anti Spam Tools

WordPress Spam Blocking Plugins: Most wordpress blogs use an amazing anti-comment spam tool called Akismet, but it is smart at identifying spam comments and moving them to the Spam Comments folder (it has blocked over a million spam comments here and you can’t even think of turning Akismet off). But what if you have to manually fish out any valid comments among hundreds of spam comments?

WordPress Comment Moderation: If you navigate to the WordPress Admin > Settings > Discussion, you will find 2 options

  1. Comment Moderation will hold a comment in the queue if it contains X (you decide, I keep it at 1) or more links. (A common characteristic of comment spam is a large number of hyperlinks.) So when a comment contains any of these words in its content, name, URL, e-mail, or IP, it will be held in the moderation queue. 
  2. Comment Blacklist – When a comment contains any of these words in its content, name, URL, e-mail, or IP, it will be marked as spam. You can read more about these WordPress spam combating options.

So you block IP addresses via the blacklist, it will move all such comments to the spam queue, but that still means work for bloggers to screen for valid comments (unless you prefer to click “Delete all Spam”, which will also delete any useful comments, and invite query from readers as to why you deleted their comments). Did you know many valid comments are often blocked by Akismet and affected commentators can request Akismet to despam your valid comments.

Of course you can edit your .htaccess file to block some IPs, but how many times can you keep doing that manually?

Ban Spam IP: Stop Comment Spam

Welcome to WP-Ban, a very powerful wordpress plugin which helps you easily ban users by IP, IP Range, host name and referrer url from visiting your WordPress’s blog and prevent spam from ever reaching your comments. It will display a custom ban message when the banned IP, IP range, host name or referrer url tries to visit your blog.

The Ban Stats can reveal valuable info about spam attempts –
ip ban

Ever since I have enabled this plugin, my spam comments are nearly zero and I can now easily screen and approve any comment wrongly labelled as spam.

But there is a word of caution, do NOT block your own IP. Do NOT use wild cards to block a large number of IPs or domains carelessly or you could be blocking thousands of your own readers and search engine bots. If you simply block the IPs which occur too frequently in your spam comments, ban those IPs and see your spam reduce in minutes.

Share with friends

About the Author: P Chandra is editor of QOT, one of India's earliest tech bloggers since 2004. A tech enthusiast with expertise in coding, WordPress, web tools, SEO and DIY hacks.