Automatically Mark Comments as Spam in WordPress

The Comment Spam Problem

Comment spam is an often encountered problem for WordPress users. It is not uncommon to receive over a thousand spam comments every week, but this high level of spam can significantly damage your reputation if you do not tackle it. It is thus very important to stop spammers. WordPress has solid built-in tools to prevent comment spam, but spammers use various tactics, so unfortunately there exists no ‘one size fits all’ method to protect your comments from being spammed. In this tutorial we help you to automatically mark certain comments as spam.

If you want to know how to stop comments on a very specific page or post, click here. If you want to find out more generally how to approve comments before they appear on your WordPress site, click here. If you want to configure that only logged in and registered users can comment on your site, click here. If you want to receive or stop the reception of comment notification emails, click here.

Creating a Comment Blacklist

In this tutorial, we explain how you can try to tackle the problem by creating a “comment blacklist”. If a comment matches your blacklist, the comment will be nuked and it will not appear on your WordPress site or blog. The comment will instead be marked as spam. When you create a comment blacklist, it is very important to choose your blacklist words wisely. Be careful though, blacklisting a word like ‘ass’ will automatically delete all comments that contain ‘ass’, e.g. assistance, assumption, etc.

How to automatically mark comments as spam in WordPress

To make sure that comments that contain specific words in their content, words, url or IP will be marked as spam, open your WordPress dashboard. You see the word ‘Settings’ in the vertical list of words running down the left side of the homepage.Wordpress DashboardClick or hover over ‘Settings’ and you will see several categories to choose from.WordPress Settings MenuClick ‘Discussion’.WordPress Discussion SettingsThere are several discussion settings that you can edit. Scroll down. To create a comment blacklist, look at ‘Comment blacklist’. Type in the words that will mark comments containing these words in their content, words, url or IP as spam.Wordpress Discussion Comment spam BlacklistClick ‘Save Changes’ to end.WordPress Discussion Settings Save Changes

You may also like...