Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Search API HTML Element Filter 1.0.7 Minor update available for module search_api_html_element_filter (1.0.7). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). Varbase Media Header 9.2.1 Minor update available for module varbase_media_header (9.2.1). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

SpamAway

1,369 sites Security covered
View on drupal.org

This module adds an extra layer of spam protection to webforms by analyzing submitted text, limiting similar submissions, and restricting submissions from the same IP address within a set timeframe. It works best when used alongside other anti-spam measures like honeypots.

When Antibot & Honeypot aren't sufficient and you don't want those in your face anti spam captchas, this is the module for you!

What is it?

This module was created because Antibot/honeypot were still being bypassed thus we created an extra anti spam measure for webforms. Although it can be used standalone, it is still advised to use this module as an extra measure, next to other modules like antibot/honeypot.

What does it do?

It will mark webform submissions as spam:

  • By analysing text of previous submissions and rating it by similarity. A similarity threshold is then used to decide if a submission is considered spam or not.
  • Limit these similar submissions within a configurable period of time
  • Limit submissions from the same IP within a configurable period of time

How can I use/add this?

This module provides a webform handler.
Thus adding this handler to your webform and configuring it properly will most likely eliminate spam attacks.

Notes

  • Query limit has a hard limit of 200!, setting it any higher won't have any effect. This is done for performance reasons
  • Warning: this will handle SPAM attacks, but it doesn't eliminate SPAM 100%.
    What does this mean? It can happen that one, two, three (depending on your settings) SPAM submissions get through before the code kicks in.

More information/descriptions about the configuration options can be found in the field descriptions in the handler configuration form.

Auto add this handler to new webforms

/**
 * Implements hook_ENTITY_TYPE_insert().
 */
function MY_HOOKY_webform_insert(WebformInterface $webform) {
  /** @var \Drupal\webform\Plugin\WebformHandlerManagerInterface $handler_manager */
  $handler_manager = \Drupal::service('plugin.manager.webform.handler');
  // Create webform handler.
  $handler_configuration = [
    'id' => 'spamaway_anti_spam_forms',
    'label' => 'SpamAway - Anti spam handler',
    'handler_id' => 'spamaway_anti_spam_handler',
    'status' => 1,
    'weight' => 0,
    'settings' => [],
  ];
  $handler = $handler_manager->createInstance('spamaway_anti_spam_forms', $handler_configuration);
  // Must set original id so that the webform can be resaved.
  $webform->setOriginalId($webform->id());
  // Add webform handler which triggers Webform::save().
  $webform->addWebformHandler($handler);
}

Supporting organizations

  • Federal Police Belgium

Activity

Total releases
4
First release
Apr 2025
Latest release
8 months ago
Releases (12 mo)
2
Maintenance
Slowing

Release Timeline

Releases

Version Type Release date
2.0.3 Stable Oct 20, 2025
2.0.2 Stable Oct 14, 2025
2.0.x-dev Dev Apr 18, 2025
2.0.1 Stable Apr 18, 2025