Captcha Keypad blocks spam registrations and form submissions with an
on-screen numeric keypad instead of distorted text — a privacy-friendly
alternative to reCAPTCHA that keeps every request on your own site.
No third-party service. No Google. No data leaves your server, so there is
nothing extra to declare in your privacy policy.
Why a keypad
Distorted-text CAPTCHAs are solved by OCR, and image recognition has made most
"pick the traffic lights" challenges cheap to bypass. Captcha Keypad asks for
something a scripted bot does not do by default: read a short code from the
page and click it, key by key, on a keypad whose buttons move on every load.
Features
- On-screen numeric keypad — visitors click the code rather than type it.
- Shuffled keys — button order is randomised on every page load, so recorded click coordinates are useless.
- Three layouts — Plain, Horizontal and Vertical, to suit your theme.
- Configurable code length — from a single digit up to sixteen.
- Skip for administrators — trusted users are not challenged.
- Choose the forms you protect — user registration, login, login block, password reset, contact forms, comments, forum topics and any content type.
- Works with CAPTCHA, or on its own — use it as a CAPTCHA challenge type, or let Captcha Keypad place itself on the forms you pick.
Requirements
Drupal 10.2, 11 or 12. PHP 8.1 or later. No other modules required.
Installation
composer require 'drupal/captcha_keypad:^2.0'
Enable the module, then configure it at
Administration › Configuration › System › Captcha Keypad
(`/admin/config/system/captcha_keypad`).
Pick a code length, choose a layout, and tick the forms you want protected.
That is the whole setup.
Using it with the CAPTCHA module
If the CAPTCHA module is installed, Captcha Keypad registers itself as a
challenge type called Keypad, and you assign it to forms from CAPTCHA's own
settings page instead.
Note: the CAPTCHA module does not yet support Drupal 12. On Drupal 12, use
Captcha Keypad on its own until that lands.
Accessibility
The keypad has to be clicked or tapped; typing the code is rejected. It is
therefore not suitable as the only challenge on forms that must be usable by
keyboard-only or screen reader users. Consider pairing it with an accessible
alternative on those forms.
Similar modules
Antibot, Honeypot, CAPTCHA, Image CAPTCHA, Botcha, Spamicide.
Disabling
If you don't want to be filling in this for on your local/dev environment, you can disable it based on Environment variables or any other condition:
// Disable captcha keypad on Dev environment
if (!is_null(getenv('ENVIRONMENT') && getenv('ENVIRONMENT') == 'dev') {
$conf['securepages_enable'] = 0;
}
Contributing
Issues and merge requests are welcome in the https://www.drupal.org/project/issues/captcha_keypad.
Supporting
If you want to support this project you can use https://gratipay.com/~marcelovani/
Live demo
Project information
- Project categories: Access control, Security
- Ecosystem: CAPTCHA, Security
315 sites report using this module
- Created by marcelovani on , updated
Stable releases for this project are covered by the security advisory policy.
Look for the shield icon below.



