Extra Block Types (EBT) - New Layout Builder experience❗

Extra Block Types (EBT) - styled, customizable block types: Slideshows, Tabs, Cards, Accordions and many others. Built-in settings for background, DOM Box, javascript plugins. Experience the future of layout building today.

Demo EBT modules Download EBT modules

❗Extra Paragraph Types (EPT) - New Paragraphs experience

Extra Paragraph Types (EPT) - analogical paragraph based set of modules.

Demo EPT modules Download EPT modules

Scroll

Drupal - Contact module, CAPTCHA. Feedback form with captcha

17/04/2025, by Ivan

To learn how to create a contact form with CAPTCHA, watch the video linked in this article.

 

A contact form has long become an essential part of a company website. It’s used by clients and customers to get in touch with the site owner or company managers. In Drupal, this functionality is provided by the built-in Contact module. Using the Contact module and an additional CAPTCHA, we’ll add a spam-protected contact form to the site.

Let’s enable it. A new item should appear in the admin menu under Structure - Contact form.

Drupal contact form

Let’s add a contact category and name it Manager.

contact form

Now the contact form is available at the address: your_site_name/contact

contact form

Let’s add another contact for the site administrator and name it Administrator. Now the contact form will display a dropdown to choose the contact category.

After setting up the contact form, you need to configure CAPTCHA to protect it from spam. If the contact form is left unprotected, someone could write a script to automatically send messages. For that, we’ll need to install the CAPTCHA module, which adds CAPTCHA to forms. Download and install this module. To configure it, go to the admin menu under Configuration - CAPTCHA settings.

Drupal CAPTCHA

On this page, choose the CAPTCHA type you want to use for the form. You can also select CAPTCHA types for user registration forms and comment forms. Save the settings. Now the contact form will include a CAPTCHA for both registered and anonymous users. However, if you’re logged in as the admin user, you might not see the CAPTCHA. Let’s configure CAPTCHA so that it appears only for anonymous users. This is done through permissions. Go to the admin menu under People - Permissions.

Drupal access permissions

The contact form is now configured. The only thing left is to add a menu link to the contact form. You can read how to add a menu item in one of the previous lessons.