Fixed Knowledge Base

Get all the help you need here.

Stop Spam Comments

Posted 04th октомври, 2018

Spam comments are where fake comments and posts are made on a Wordpress website. They can be frustrating, but also negatively affect site perception and SEO.

These comments are almost always posted by automated bots.

Contents

  • Types of spam comments
  • Blocking spam bots
  • Content filtering
  • Disabling trackbacks and pingbacks
  • Using a captcha
  • Useful links

Types of Spam Comments

The three most common type of spam comments are as follows.

  • Malicious spam comments. These often include a link to a third party website with malicious content, the intention being to infect the visitor's machine for phishing purposes.

  • Backlink spam. These are halfway-relevant posts made by bots, which aim to send backlinks for SEO purposes to other websites.

  • Trackback spam. - Trackbacks link Wordpress sites together in a form of conversation, essentially with Site B linking to Site A in exchange for a previous link. This is abused by bots, who set up a trackback and then remove the original link.

None of these comments or links are beneficial and you should block and/or remove them.

Blocking spam bots

Spam bots are automated scripts. There are four possible ways to block them.

Htaccess Block

The .htaccess file is a server side file that tells your web server how to handle requests. It can be used for allowing and blocking access to files.

The following code will block access requests from common spam bots. Any new bots can also be added to the list in the same format.

SetEnvIfNoCase Referer semalt.com spambot=yes
SetEnvIfNoCase Referer econom.com spambot=yes
SetEnvIfNoCase Referer buttons-for-website.com spambot=yes
SetEnvIfNoCase Referer ilovevitaly.com spambot=yes
SetEnvIfNoCase Referer ilovevitaly.ru spambot=yes
SetEnvIfNoCase Referer darodar.com spambot=yes
SetEnvIfNoCase Referer 7makemoneyonline.com spambot=yes
SetEnvIfNoCase Referer myftpupload.com spambot=yes
SetEnvIfNoCase Referer priceg.com spambot=yes
Order allow,deny
Allow from all
Deny from env=spambot

Content filtering

Content filtering is essentially a spam filter for comments. Comments triggered by this filter will be nuked and be marked as spam. Content filtering can be configured as follows:

  1. Log into the Wordpress Admin Area
  2. Navigate to Settings > Discussion
  3. Add any words to filter in the Comment Blacklist section. Be cautious as partial words can match and you may trigger false positives.

Disabling Trackbacks and Pingbacks

Trackbacks and Pingbacks can be disabled. This will of course disable them for everyone, so may not be desired.

  1. Log into the Wordpress Admin Area
  2. Navigate to Settings > Discussion
  3. Disable the trackbacks and pingbacks by unticking the options in the Default article settings

Using a captcha

Captcha verification are tools that verify a visitor is human; either asking them to solve a puzzle or enter a string of text. It is difficult for an automated script to bypass this obstacle.

The best option for captcha verification is to install a captcha plugin of your choice.

Useful links

Official WordPress codex