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

Calibrate

Supporting organizations: 

Project information

Releases