Vital Tips and Tools to Combat Spam Comments in WordPress

Combat Spam Comments in WordPress

WordPress blogs often face this issue of combat spam comments and hence this article tries to explain how to combat.

Not just one or two website, but hundreds of them are facing this. If you are not prepared to combat spam comments then it can create terrific problems for you and the website as well.

Spam comments are spread with the purpose to get ranked in search engines which usually happens when a visitor accidentally clicks a link. Spam comments are the results of the actions of not just bots but also humans. Here we will discuss vital tips & tools to combat spam comments in WordPress.

combat spam comments

1.) Comment Moderation

how to combat spam comments

You have to ensure that no comment on the blog is published without your permission. The following step will ensure that no comments are bypassed from the filter which gives you complete control over your website.

Inside the WordPress admin section select the discussions option from Settings Menu. Here check the box next to “comment must be manually approved”, in before a comment appears section. Now saving changes here will enable you to select which comments to display and which ones to ignore.

2.) Akismet Anti-Spam Protection

akismet spam comments filter

This is an anti-spam plugin which comes pre-installed on the WordPress platform. Through their anti-spam database, it filters all the comments of your website and identifies the most common spammed comments.

It is a free plugin but requires API key signup. For a personal blog or a small website, it is free.

3.) Using Sucuri

sucuri website protection

Akismet can identify spam comments but it cannot prevent spammers to access the website. Multiple spam comment requests will immediately slow down the website.

Sucuri is a WordPress firewall plugin to efficiently combat spam comments. It can prevent scripts and spambots from submitting comments. It significantly reduces the number of spam comments received and also reduces the load of the website server.

4.) HoneyPot

honeypot spam comments detection

A significant method that tricks the spambot to reveal their identity is Honeypot Technology. Immediately after the identification, their comments can be blocked. First, install and activate the Antispam Bee plugin.

After activation, find the Antispam Bee page from the setting options and check option as a mark which says ‘Spam for all honeypot caught comments’. Save the changes in the settings and this technology will catch all the bad spambots in comments.

5.) reCAPTCHA

captcha spam comments protection

An advanced form of CAPTCHA that differentiates between a human user and robots is reCAPTCHA. Using reCAPTCHA in WordPress comments plugins helps you in activating the reCAPTCHA challenges in the comment forms.

By clicking on the checkbox button, Google makes it easy for users to verify their identity. If Google suspects a spambot then it provides them with a difficult challenge making it extremely tough for them to bypass.

6.) Removing Website URL

A URL in the comment section is harmful because it does not limit itself to attracting other spammers but it also tricks visitors into visiting the URL without any direct link with them. To avoid such URLs, add the following code in the site-specific plugin or themes functions.php file.

function wpb_disable_comment_url($fields) { 
unset($fields['url']);
return $fields;
}
add_filter('comment_form_default_fields','wpb_disable_comment_url');

Removing Website URL fields is an essential step to combat spam comments.

7.) Disabling Media Attachment Comments

disable comments spam

Image attachment pages are automatically created by WordPress for users to see the image and leave a comment. If this is not useful to you or you do not want users to comment on the images then you can turn off comments on medial attachments.

For convenience, install the Disable Comment plugin and check the box next to media in the Settings menu to disable comments and save changes. It will successfully disable comments on media attachments.

8.) Disable HTML

Disabling HTML in comments is also another recommended method to discourage links in comments. Add the following code to your site-specific plugin or themes functions.php file. It will help in changing HTML codes in HTML entities.

function wpb_comment_post( $incoming_comment ) {
    $incoming_comment['comment_content'] = htmlspecialchars($incoming_comment['comment_content']);
    $incoming_comment['comment_content'] = str_replace( "'", ''', $incoming_comment['comment_content'] );
    return( $incoming_comment );
    }
    function wpb_comment_display( $comment_to_display ) {
     $comment_to_display = str_replace( ''', "'", $comment_to_display );
     return $comment_to_display;
}
add_filter( 'preprocess_comment', 'wpb_comment_post', '', 1);
add_filter( 'comment_text', 'wpb_comment_display', '', 1);
add_filter( 'comment_text_rss', 'wpb_comment_display', '', 1);
add_filter( 'comment_excerpt', 'wpb_comment_display', '', 1);
remove_filter( 'comment_text', 'make_clickable', 9 );

9.) Deciding the Comment Length

Yoast Comment Hacks plugin is a resourceful method to combat spam comments through which you can set a maximum and minimum length for one comment.

This helps in tackling spammers who leave hundreds of comments in a time frame with a normal keyword that is not spam. It forces the user to leave a meaningful comment and not just a word.

10.) Disable Trackbacks

disable trackbacks comments

Trackbacks comprise a large section of the comment SPAM. For most of the blogs, it makes no sense to enable trackbacks. You can conveniently choose to disable it for all post or individual posts which will result in reducing the comment SPAM considerably. You can find this option in Discussion option in the Settings menu.

11.) Old Posts

Websites that are updating content timely can choose to turn off comment for old posts which are on the site for a prolonged period.

You have to find the ‘Other comment settings’ option in the Discussion section of the Setting menu. Here check on the box that says ‘Automatically close comments on articles older than’ and enter the number of days after which you intend to disable comments.

Please note that comment deadlines can be overridden for individual posts at any time from Settings.

12.) Switch Off Comments

turn off comments

If in any case, the comment moderation of your blog or website is uncontrollable you always have an option to disable comments. This can also be selected when you intentionally do not require any comments on the post.

To disable all comments go to Discussion option from the Settings Menu and find “Allow people to comment on new articles” option and uncheck the same. Save changes in the settings.

An impactful method to combat spam comments is by enabling comments only from registered users which can be found in the Discussion section only.

Another article for similar concept has been explained here which deals with fight spam in WordPress.

About Sonl Sinha

Sonl SinhaSonl Sinha is a passionate writer as well as WordPress and WooCommerce rockstar who loves to share insights on various topics through his engaging blog posts. He runs a successful website design and digital marketing company. With 15+ years of experience in WordPress theme development, he strives to inform and inspire readers with his thought-provoking content. He helps thousands of small and medium businesses and startups create a unique online presence. Follow Sonl Sinha for your regular dose of knowledge and inspiration.

Do check out our free WP themes and WordPress themes bundle