CAPTCHA for Drupal Webform contact forms

To add CAPTCHA to forms using the Webform module, for example contact forms:

  • Install and enable the Captcha module
  • Go to settings of the CAPTCHA module /admin/config/people/captcha
  • To ensure, CAPTCHA is used in every possible and available way,
    • Enable:
      Default challenge on non-listed forms.
      Enable CAPTCHA for every form not listed here
    • Save
  • In front-end view, navigate to your webform where CAPTCHA is missing. We need to identify its Form ID to be used in the next steps
  • To get the Form ID
    • View source, and find or search in the code: form_id
    • After the code name="form_id" there should be a value shown as: value="some_weform_value_here" (see example screenshot)
    • Copy that value to be entered in next step 
      Captcha form id for Webform in Drupal 8
  • Go to Form Settings /admin/config/people/captcha/captcha-points, where all forms having the captcha enabled or made available by default
    • Identify the contact webform, e.g. contact_message_feedback_form
    • Edit, and paste the copied value from previous step into the required Form ID
    • Save
  • Clear cache, and check that default CAPTCHA is now available and displayed

This is a simple explanation, for clarity, of the instructions as posted here: https://www.drupal.org/project/captcha/issues/2736881#comment-13594561

Leave a Comment

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
To prevent automated spam submissions leave this field empty.
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.
13 + 0 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.
Get reliable web hosting services

Recurring donation

Make Donation

  • Other: $

Donate now

Single donation

Make Donation

  • Other: $

Donate now