Honeypot uses both the honeypot and timestamp methods of deterring spam bots from completing forms on your Drupal site (read more here). These methods are effective against many spam bots, and are not as intrusive as CAPTCHAs or other methods which 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
- Preventing Form Spam - article about different spam prevention techniques.
- Introducing the Honeypot form spam protection module for Drupal
Related modules
- Honeypot Entityform - Adds entityform integration
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 - Implements reCAPTCHA for image-based CAPTCHAs.
- BOTCHA - Has many different bot-defeating recipes.
- Hidden CAPTCHA - Similar to this module in it's effectiveness.
Pledges
#D8CX: I pledge that Honeypot will have a full Drupal 8 release on the day Drupal 8 is released. Fulfilled!
#D9CX: I pledge that Honeypot will have a full Drupal 9 release on the day Drupal 9 is released. Fulfilled!
Module created by Jeff Geerling
Project information
- Module categories: Content Editing Experience, Security
- 147,933 sites report using this module
- Created by geerlingguy on , updated
- Drupal 10 is here!
The 2.1.x branch of this module works on Drupal 10 and is being tested against Drupal 10 on a weekly basis. See https://www.drupal.org/pift-ci-job/2771621 for the most recent test results.
- Stable releases for this project are covered by the security advisory policy.
Look for the shield icon below.
Releases
Minor changes. See release notes for details.
Development version: 2.1.x-dev updated 12 Oct 2023 at 16:52 UTC
Development version: 7.x-1.x-dev updated 13 Dec 2019 at 21:13 UTC