This project is not covered by Drupal’s security advisory policy.
Provides a Webform handler that limits the total number of submissions of a webform, and keeps the limit correct when many users submit at the same time. No Redis or other service is required.
Features
Webform's own submission limits, and other limit modules, count submissions with a plain query before saving. When several users submit at nearly the same moment, all of them pass the check and the limit is exceeded (see #3516612 and #3260587, closed as won't fix in Webform with a suggestion to solve it in a contributed handler).
This module reserves every slot with a single atomic database update, so two requests can never take the same slot:
- Exact total limit under concurrent submissions (tested with 60 simultaneous submissions against a limit of 20: exactly 20 accepted).
- Works for Webform forms and for submissions created through code or an API (
WebformSubmissionForm::submitFormValues(), webform_rest, JSON:API, decoupled front ends). - Only completed submissions count: wizard pages, previews, drafts and edits of existing submissions do not take a slot.
- Deleting a completed submission frees its slot.
- Customizable warning message; the current counter can be adjusted on the handler settings form.
Use it for registrations, bookings, ticket sales, giveaways, or any form where the number of submissions must never go above a fixed number.
Post-Installation
- Go to the webform's Settings > Emails / Handlers page.
- Add the Database limit submission handler.
- Set the Total limit and, optionally, a Warning message.
The module stores one counter row per webform in its own table, which is removed when the module is uninstalled. Uninstalling keeps your webforms and only removes the handler.
Additional Requirements
- Webform 6.2 or later
- Drupal 10.1, 11 or 12
Recommended modules/libraries
For forms with extremely high traffic on sites that already run Redis, Webform Redis Limit Handler provides the same behavior with a Redis counter.
Similar projects
- Webform core limits: simple total/user limits, not safe under concurrent submissions.
- Webform Submissions limit: limits by submitted data over a time window (anti-spam), not concurrency-safe.
Project information
- Project categories: Decoupled
- Ecosystem: Webform
- Created by hoanglv on , updated
This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.
