punish the user [YouTube].

The module currently supports enabling for all forms on the site, or particular forms like user registration or password reset forms, webforms, contact forms, node forms, and comment forms.

Configuration

All settings for this module are on the Honeypot configuration page, under the Configuration section, in the Content authoring settings. You can visit the configuration page directly at /admin/config/content/honeypot. Read more about what all the settings mean in the Honeypot documentation.

Use in Your Own Forms and Customizations

If you want to add honeypot to your own forms, or to any form through your own module's hook_form_alter's, you can simply place the following function call inside your form builder function (or inside a hook_form_alter()):

  \Drupal::service('honeypot')->addFormProtection($form, $form_state, ['honeypot', 'time_restriction']);

Note that you can enable or disable either the honeypot field, or the time restriction on the form by including or not including the option in the array.

You can also use Honeypot's API to modify the time delay for forms, add or remove protections for certain forms, etc.

Success Stories

Many people have reported dramatic reductions in spam when using this module; some of their stories can be found here: Honeypot success stories.

Further Reading

Related modules

Alternative modules

There are many spam-protection modules on drupal.org, some of which have more or less robust methods of dealing with form spam. Some of the most used and recommended include:

  • CAPTCHA - A simple image-based CAPTCHA builder.
  • reCAPTCHA for image-based CAPTCHAs.
  • AntiBot A JavaScript based strategy for eliminating form submissions from bots.
  • BOTCHA - (Drupal 7) Has many different bot-defeating recipes.
  • Hidden CAPTCHA - (Drupal 7) Similar to this module in it's effectiveness.

Module created by Jeff Geerling

Supporting organizations: 

Project information

Releases

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant