Webform

Webform is a contributed Drupal module for building forms, collecting submissions and sending them on by email or to other systems, with no code.

Learn DrupalDrupal glossary

Webform is a contributed Drupal module that lets you build forms in the browser and manage what visitors send in. You add fields, choose what happens after someone submits, and read the results in the admin. Contact forms, surveys, registrations, job applications and donation requests all fit.

How Webform works in Drupal 11

Webform is not part of core. You install it like any other module, with Composer, and enable it on the Extend page. The 6.3.x branch supports Drupal 10.3 and later and Drupal 11.

The module is split into sub-modules, and you enable the ones you need:

  • Webform UI adds the admin interface for building forms. Without it, forms still work and collect data, but there is no admin interface.
  • Webform Node adds a content type, so a form can be placed on a page as a node.
  • Webform Templates provides starter forms such as Contact Us, Donation, Job Application, Registration and Subscribe.
  • Webform Share lets other websites show your form in an iframe.
  • Webform Scheduled Email Handler allows emails to be sent later.

Each form is made of elements: text fields, dates, file uploads, entity references, Likert scales and composites such as name and address. After a visitor submits, handlers run. A handler runs when a submission is created, updated or deleted. The email handler sends notifications and confirmations; the remote post handler sends selected elements to another server.

Example: a contact form on its own page

  1. Enable Webform and Webform UI, then open Structure › Webforms (/admin/structure/webform).
  2. Add a webform, or start from one of the starter templates.
  3. Add the elements you need and drag them into order, then add an email handler so the form sends a notification.
  4. Save the form. It has its own address, such as /webform/contact, that you can link to.

To put the same form inside a page layout, place the Webform block under Structure › Block layout, or create a node that references the form.

Results and access

Submissions can be reviewed online, flagged, locked and annotated, and downloaded as CSV. For custom reports, the results can be shown with Views. Access is controlled per form: you can grant who may administer a form and who may view, update or delete submissions, by role or by individual user. Set the general permissions at /admin/people/permissions#module-webform.

Common mistakes

  • Leaving the results open to too many roles. Submissions often hold personal data. Give the view-submissions permission only to the roles that need it.
  • Keeping every submission forever. Webform can purge submissions automatically and limit how many a user or a form accepts. Decide the retention period when you build the form.
  • No spam protection. A public form attracts bots. The Webform documentation lists spam protection among its add-ons; pick one before the form goes live.
  • Assuming the email arrived. Test the handler with a real submission, and check where the notification goes if the recipient changes jobs.

For marketing and content teams

With Webform, a marketer can change a form without a developer: add a question, reorder fields, change the confirmation message or the notification address. Form data lives on your own site, so you decide who sees it and how long it stays. Ask your developers to connect the handler to the CRM you use, so leads do not wait in an inbox. Starter templates are a faster start than a blank form.

With DXPR

DXPR Builder places a webform through the Webform block, the same way it places other Drupal blocks. You drop the form into a column next to your copy and keep the layout editable. See DXPR Builder.

Sources

Questions about Webform

No. Webform is a contributed module, so you install it yourself, for example with composer require drupal/webform, and then enable it on the Extend page.

Yes. The project page lists the Webform 6.3.x branch for Drupal 10.3 and later and for Drupal 11, and says no other versions are supported besides the 6.2.x branch, which has security support until Drupal 10 reaches end of life. Use 6.3.x on Drupal 11.

Webform keeps submissions on the site, where you can review them, flag or annotate them and download them as a CSV file for Excel or Google Sheets. You can turn storage off for a form, or purge old submissions automatically.

You have three options: link to the form's own address, such as /webform/contact, create a node that references the form, or place the Webform block in a region. The node option needs the Webform Node sub-module.

Yes, in two ways. The built-in remote post handler sends selected elements to a remote server. Add-on modules cover CRM integrations such as Salesforce and HubSpot, according to the Webform documentation.

Related terms

All Drupal terms from A to Z