[Drupal] How to protect your site from spam attacks using Honeypot module

| | 2 min read

The Honeypot modules is a SPAM prevention module that uses a hidden form field to catch SPAM bots from posting onto your Drupal site. This article help to configure the module to work on various forms on your Drupal websites.

Working

Honeypot adds a hidden field to the form that users won't see but spam bots will.The working of Honeypot Module works is it adds invisible field to any form that you specify.As a user you don’t see this field so you won’t fill it in, but spam bots fills it in and then once that field has any information inside of it, it automatically spammed or caught it spam and then not posted to your site.

Configuration

Install Honeypot module and configure it through the link.

Home » Administration » Configuration » Content authoring

You can change the Honeypot element name and set Honeypot time limit.

Check the boxes next to individual forms on which you'd like Honeypot protection enabled forms

If you see any element with the class 'honeypot-*' and a label 'Leave this field blank'. Then its a honeypot field and its enabled.

  • A 'honeypot' field (with a common title like 'homepage' or 'url', to make it even more tantalizing) that is hidden from normal users using CSS or JavaScript, and is not allowed to have any content entered into it.
  • A time value is attached to the form and requires a certain amount of time to pass before form submission is accepted.

Honeypot time limit configures the required amount of time a form must be displayed before it is submitted. Spam bots will blaze through a form and submit it instantly, but humans take a little longer time to submit forms.

Honeypot is only useful against automated spam attempts. These days, spam is increasingly created by humans. This is where a tool like Mollom with its text analysis comes more into play. The combination of both tools can be a powerful weapon in the fight against spam on sites of all sizes.