I am using Webform on Drupal 8; I have a few spambots that fill out the exact same form in the same way every day.

I want to do some kind of validation that automatically blocks these postings. For example, if the name given is "Spambot 1", I want to discard the webform submission automatically.

Drupal 7 has the Webform Validation module but this has not yet been ported to Drupal 8.

I found a code snippet on adding custom validation to a webform element, but this seems to be for providing helpful errors to allow the user to re-submit the webform, whereas I want to make it seem like the form was submitted but silently discard the submission.

  • Is Honeypot out for D8? – Kevin Jan 7 '19 at 1:04
  • @Kevin Yes, I have Honeypot enabled but I'm still getting a few specific spambots every day. – Patrick Kenny Jan 7 '19 at 3:23
  • Even if you implement that, you still risk in the future getting spammed by new bots that fill out the form differently. If you use reCaptcha that will be the end of it. – No Sssweat Jan 7 '19 at 7:42
  • Definitly reCaptcha as @NoSssweat suggested, there even is an "invisbile" reCaptcha that is completely hidden from real users most of the time. It is silent to normal users and prevents submissions / forces captcha only on suspicious submits. – Hudri Jan 7 '19 at 11:23

All the available SPAM protection modules for Drupal 8 are listed on the Webform Add-ons documentation page.

Text inputs now support patterns, you could explore creating a negative lookahead pattern like ^(?!.spam).$,

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.