No Website Url Less Spammers
Removing Website URL from Comment Forms Stops Spammers
Another way to stop spam comments – get rid of the website URL in comment forms. We’ve finally got rid of nearly all spam comments on graphicline.co.za. Although the site was already protected by Project Honeypot, and comments use a CAPTCHA challenge, we were still getting a lot of spam. Instead of switching to RECAPTCHA with it’s more difficult text, we looked for another way to reduce successful spam comments.
The common factor to all spam comments was the inclusion of a homepage URL in the form field. The thinking was; if there’s no field for the URL, then spambots may fail as they can’t finish their job. Without a homepage URL field, manual spammers may be discouraged from posting rubbish as well.
We’d already had a lot of success dealing with WordPress comment spam by removing the link, now it was time to have a go with a Drupal site.
Code Mod Instead of Module for Drupal Site
There’s no suitable module for Drupal to remove the comment form homepage URL field, or I should rather say there isn’t one we found suitable. But that’s not a problem, a simple php function added to the relevant theme file – in our case “comment-wrapper.tpl.php” removes this field.
You need to find div id=”comments” – usually the first part of the file and look for something similar to this line (it should be immediately after the opening div)
<?php if ($content['comments'] && $node->type != 'forum'): ?>
Add the following immediately after this line
<?php $form['author']['homepage']['#access'] = FALSE; ?>
And that’s the end of the homepage URL field.
No Spam Since Homepage URL Removed
The result is we’ve not seen one spam comment on this site since removing the field. We still see a lot of spammer activity in server logs, but the bots are failing when they don’t find the place to include the spam link.
Spam bots hit the site every few minutes, 24 hrs a day looking for /comment-reply and /node-add/. The Honeypot httpbl log gets a thousand and more entries a day.
It’s possible removing the comment-form homepage URL is the best way of stopping spammers.