How to Add hCaptcha to Magento 2 Forms

Last updated: November 2026 · WebForms steps follow the WebForms 4 documentation. Grasch_HCaptcha details come from its GitHub repository (release 1.3.0).
hCaptcha for Magento 2 is a CAPTCHA service you can use instead of Google reCAPTCHA. Its Basic plan costs nothing. There are two ways to add it to a Magento 2 store. The free open-source Grasch_HCaptcha module adds hCaptcha to Magento’s own forms, such as customer login, contact and checkout. WebForms Suite, the WebForms 4 extension by MageMe, has hCaptcha built in for the forms you build with it. This guide covers both.
Which path is right for you?
Option A · Free Grasch_HCaptcha module
Adds hCaptcha to Magento’s own forms. MIT license, no fee.
- Admin login and forgot password
- Customer login, registration and account edit
- Contact, product review, newsletter
- Checkout, coupon codes, send to friend
Option B · WebForms Suite
hCaptcha on the forms you build in WebForms 4 — contact forms, quote requests, surveys, file uploads.
- Built in, no extra module
- One rule for the store, or a different rule on one form
- Guests only or all visitors
- Luma, Hyvä and Breeze
Why Choose hCaptcha Over reCAPTCHA
Magento has Google reCAPTCHA built in. Some stores prefer a CAPTCHA service that is not run by Google, and hCaptcha is one of them. This is what hCaptcha says about its service on its pricing page and its GDPR page (checked in November 2026):
- Plans. The Basic plan is free. The paid Pro plan adds a low-friction passive mode, custom themes and analytics.
- Compliance. hCaptcha says its plans comply with GDPR, CCPA, LGPD and PIPL.
- Where data is processed. hCaptcha processes metadata for its customers in its main data centers in Europe and, if applicable, the US.
- Personal data. hCaptcha acts as a data processor and says it does not sell or rent the personal data of the people who solve its checks. It is enrolled in the EU-US Data Privacy Framework.
Whether your store needs visitor consent before any CAPTCHA loads depends on your setup and your consent tool. Ask your data protection adviser. For Google reCAPTCHA and Cloudflare Turnstile, see our Magento 2 spam protection guide.
Option A — Free Grasch_HCaptcha Module
The open-source Grasch_HCaptcha module builds on Magento’s own reCAPTCHA modules (Magento_ReCaptcha*). It adds hCaptcha as another CAPTCHA type in Magento’s reCAPTCHA settings. You then select hCaptcha for each Magento form you want to protect. The forms themselves don’t change.
Grasch_HCaptcha
MIT · Composer: grasch/module-hcaptcha · requires PHP 7.4 or later and magento/security-package 1.1.3 or later
The project publishes no list of tested Magento versions, and its last release is 1.3.0 (November 2023). Test it on a staging copy of your store first.
Its README lists these places:
- Admin login and forgot password
- Customer login and forgot password
- Create and edit customer account
- Contact Us
- Product review
- Newsletter subscription
- Send to friend
- Checkout and placing an order
- Coupon codes
- PayPal PayflowPro payment form
- REST API and GraphQL validation
- Visible and invisible hCaptcha
Install via Composer
From your Magento 2 root directory:
composer require grasch/module-hcaptcha
bin/magento setup:upgrade
bin/magento cache:clean
If your store runs in production mode, also run bin/magento setup:di:compile and bin/magento setup:static-content:deploy.
Configure in Admin
- Sign up at hcaptcha.com, add your store’s domain, and copy the Site Key and Secret Key.
- In the Magento admin, go to Stores → Configuration → Security → Google reCAPTCHA Storefront | hCaptcha Storefront. The module adds “hCaptcha” to the names of Magento’s reCAPTCHA sections. Admin forms use Google reCAPTCHA Admin Panel | hCaptcha Admin Panel.
- Expand hCAPTCHA for a visible check, or hCAPTCHA Invisible, and paste your keys. You can also set Theme (Light Theme or Dark Theme), and for the visible check Size (Normal or Compact).
- Expand Storefront. For each form you want to protect, for example Enable for Contact Us, clear Use system value and select hCAPTCHA or hCAPTCHA Invisible. Adobe’s Google reCAPTCHA guide explains these fields.
- Click Save Config and clean the cache.
Heads up. Grasch_HCaptcha is built on Magento’s Magento_ReCaptcha* modules, and its README asks you to keep all of them enabled. They come with Magento 2.4.x. If you disabled any of them, enable them again before you install. Run bin/magento module:status and check that no Magento_ReCaptcha module is in the list of disabled modules.
Option B — Set up hCaptcha in WebForms 4
If your forms are built with WebForms Suite, hCaptcha is part of the extension and you don’t need another module. WebForms keeps its own CAPTCHA settings, separate from Magento’s reCAPTCHA settings. It also supports Google reCAPTCHA v2, v3 and Enterprise and Cloudflare Turnstile. This guide covers hCaptcha only.
Step 1: Get Your hCaptcha Keys
- Go to hcaptcha.com and create an account.
- Add your store’s domain to the key’s list of domains.
- Copy your Site Key and Secret Key.
hCaptcha also publishes test keys that let every visitor pass the check. Use the keys hCaptcha created for your store.
Step 2: Connect hCaptcha in Spam Protection
In the Magento admin, go to Stores → Configuration → MageMe Extensions → WebForms and expand Spam Protection. These settings can differ per store view. To set up one store view, select it in Scope at the top of the page first.
- In CAPTCHA Provider, select hCaptcha. The page then shows only the hCaptcha settings.
- Paste your keys into Site Key and Secret Key.
- Optionally set Theme (Light or Dark) and Widget Size (Normal, Compact or Invisible).
- Click Save Config. If a key is empty, the page doesn’t save and names the missing key.
The hCaptcha settings also include Maximum Bot Score (default 0.5, the same for the whole store). It applies only when hCaptcha sends a score with its answer, and a submission with a higher score is rejected. The settings reference lists every setting with its default.
Step 3: Choose Who Must Pass the Check
On the same page, in Require CAPTCHA for, select:
- Guests Only to ask visitors who aren’t signed in to a customer account,
- All Visitors to ask everyone, or
- Disabled to ask nobody, unless a form has its own rule.
Click Save Config. On a new installation this setting is Disabled, so no form asks for a CAPTCHA until you change it.
Step 4: Use a Different Rule on One Form (Optional)
- Go to Content → WebForms → Manage Forms and click the form’s name.
- Click User Experience in the list of sections on the left.
- In Captcha Mode, select Guests Only, All Visitors or Disabled. The default, Use Store Configuration, follows Require CAPTCHA for.
- Click Save.
The form’s rule wins over the store-wide one. You can leave Require CAPTCHA for at Disabled and protect only the form that gets spam.
Step 5: Test the Form
Open the form on your store in a private browser window, as a guest. The hCaptcha check sits where the form’s Captcha element sits, right above Submit unless you moved it. Send the form: the thank-you message replaces the form, and the submission is at the top of the Inbox.
In the form builder, click the Captcha element. Its panel shows the form’s Captcha Mode and names the CAPTCHA service with the word configured once its keys are in. See Captcha field to change where the check sits.
The Captcha panel in the WebForms 4 builder. This example store uses Turnstile; with hCaptcha selected, the panel names hCaptcha.
WebForms Suite costs €199 for Magento Open Source or €499 for Adobe Commerce, one time, with 12 months of updates and support.
When to Use Each
| Situation | Recommended approach |
|---|---|
| Protect Magento’s admin login, customer login, contact, reviews, newsletter or checkout | Grasch_HCaptcha (Option A) |
| Forms you build in WebForms (quote requests, surveys, file uploads) | WebForms (Option B) |
| Both Magento’s forms and your WebForms forms | Use both. Each has its own settings: Grasch_HCaptcha under Security, WebForms under MageMe Extensions → WebForms |
| Signed-in customers should not see a check | WebForms: Guests Only in Require CAPTCHA for or in the form’s Captcha Mode |
| Only one form gets spam | WebForms: Captcha Mode on that form, with Require CAPTCHA for left at Disabled |
| An invisible check instead of a visible widget | Grasch_HCaptcha: hCAPTCHA Invisible. WebForms: Widget Size set to Invisible |
| You prefer Google reCAPTCHA or Cloudflare Turnstile | WebForms supports both. See the spam protection guide |
Common Issues & Troubleshooting
- hCaptcha is not showing on a WebForms form. Check that the keys are filled in for the store view you’re looking at. Then check the form’s Captcha Mode and, if it says Use Store Configuration, Require CAPTCHA for. With Guests Only, sign out first: signed-in customers don’t get the check.
- Visitors see “Captcha is not set up on this store. Please contact the store owner.” The form asks for a CAPTCHA, but the hCaptcha keys are missing for that store view. WebForms then refuses every submission of that form, and the admin shows a system message with a link to the settings. Fill in the keys, or set the form’s Captcha Mode so it doesn’t ask for a CAPTCHA.
- Visitors see “The security check is not complete yet.” The visitor’s browser can’t reach hCaptcha. Common reasons are a privacy or ad-blocking browser extension, a cookie consent tool that holds back other companies’ scripts until the visitor agrees, or a security rule your hosting added to the page. Try again in a browser without extensions to tell the visitor’s browser from your store.
- Every visitor gets “hCAPTCHA verification failed.” Check that CAPTCHA Provider is hCaptcha and that both keys are pasted in full. Check that your store’s domain is in the key’s list of domains at hCaptcha. A very low Maximum Bot Score, such as 0, rejects nearly every visitor that hCaptcha sends a score for. The full checklist is in Captcha blocks every submission.
- Grasch_HCaptcha: no hCaptcha on Magento’s forms. Run
bin/magento module:statusand check that noMagento_ReCaptchamodule is in the list of disabled modules. Then check that the form’s Enable for field in the Storefront section is set to hCAPTCHA or hCAPTCHA Invisible.
Key Takeaways
- An alternative to reCAPTCHA — hCaptcha’s Basic plan is free, and hCaptcha processes metadata in Europe and, if applicable, the US.
- Magento’s own forms — the free Grasch_HCaptcha module adds hCaptcha to Magento’s reCAPTCHA settings, where you select it per form.
- Forms you build — WebForms Suite has hCaptcha built in. Connect it in Spam Protection, then ask guests only or all visitors, for the whole store or for one form.
- Keys first — a WebForms form that asks for a CAPTCHA without keys refuses submissions. Fill in the keys before you turn the check on.
- Switching later — in WebForms, CAPTCHA Provider switches between hCaptcha, reCAPTCHA and Turnstile once you enter that service’s keys. The forms don’t need to be rebuilt.
Frequently Asked Questions
hCaptcha’s Basic plan costs $0. Its paid Pro plan adds a low-friction passive mode, custom themes and analytics. The Grasch_HCaptcha module is free and open source under the MIT license. WebForms Suite is a paid extension (€199 for Magento Open Source, €499 for Adobe Commerce, one time), and its hCaptcha support is part of it.
In WebForms Suite, yes. Luma needs nothing extra. Hyvä and Breeze each get a WebForms package built for the theme, included in the license: Hyvä needs the Hyvä theme module 1.3.11 or later, Breeze needs Breeze 2.0 or later. The CAPTCHA settings are the same for all three themes. The Grasch_HCaptcha README doesn’t mention Hyvä or Breeze, so test it on your theme before you go live.
Yes. Grasch_HCaptcha is MIT-licensed, with the Composer package grasch/module-hcaptcha. It adds hCaptcha to Magento’s built-in reCAPTCHA settings, so you can select it for the admin login, customer login and registration, contact, product review, newsletter, send to friend, checkout and coupon forms. Its latest release is 1.3.0 from November 2023. It needs Magento’s Magento_ReCaptcha modules to be enabled.
In WebForms, CAPTCHA Provider is set per store view, so all forms in one store view use the same service. Each form chooses who gets the check with its Captcha Mode: Guests Only, All Visitors or Disabled. Different store views can use different services. With Grasch_HCaptcha, Magento’s reCAPTCHA settings have a separate field for each Magento form, so you can select hCaptcha for one form and a reCAPTCHA type for another.
hCaptcha says its plans comply with GDPR, CCPA, LGPD and PIPL. Its GDPR page says hCaptcha acts as a data processor, does not sell or rent the personal data of the people who solve its checks, and processes metadata in its data centers in Europe and, if applicable, the US. Whether your store also needs visitor consent before the check loads depends on your setup. Ask your data protection adviser.
Both are alternatives to Google reCAPTCHA, and WebForms 4 supports both. You switch between them in CAPTCHA Provider after you enter that service’s keys, and the forms stay as they are. In WebForms, hCaptcha offers a Normal, Compact or Invisible widget and a Maximum Bot Score. Turnstile offers a Normal or Compact widget. For more on Turnstile, see our Magento 2 spam protection guide.
Only if you build your own forms. Grasch_HCaptcha adds hCaptcha to Magento’s own forms, such as admin login, customer login, contact, review and checkout. WebForms Suite is a form builder: you build forms such as quote requests, surveys or file uploads, and its hCaptcha support protects those forms. The two are configured separately, so a store can use both.
On Magento’s own Contact Us form, check that Enable for Contact Us in the Storefront section of the reCAPTCHA settings has a CAPTCHA type selected, and that the keys of that type are filled in. On a WebForms form, check the keys for the store view, the form’s Captcha Mode and Require CAPTCHA for. With Guests Only, signed-in customers don’t see the check, so sign out to test.



