Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Release: Opensolr Search 4.5.0 Minor update available for module opensolr_search (4.5.0). Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Usage Milestone: Simplify Module simplify crossed 10,000 active installs. Usage Milestone: Views Reference Filter Module entityreference_filter crossed 10,000 active installs. Usage Milestone: Dropdown Language Module dropdown_language crossed 10,000 active installs. Usage Milestone: Paragraphs Browser Module paragraphs_browser crossed 10,000 active installs. Usage Milestone: OpenAPI Module openapi crossed 10,000 active installs. Usage Milestone: Decoupled Router Module decoupled_router crossed 10,000 active installs. Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

SpamAway

1,346 sites Security covered Drupal 10–11
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

Depends on

Dependencies of the latest stable release

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
4
Tracked since
Apr 2025
Latest release
10 months ago
Releases (12 mo)
2
Maintenance
Slowing

Release Timeline

Releases

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