Skip to content

Magento 2 ​

Official CaptchaLa module for Magento Open Source and Adobe Commerce 2.4. It adds CAPTCHA verification to six storefront forms, each with its own on/off switch, without writing code.

Every widget is backed by a server-issued, single-use token, and each submission is checked on your server before Magento runs the form's controller.

What it covers ​

FormActionSetting
Customer loginloginProtect customer login
Customer registrationregisterProtect customer registration
Forgot passwordlost_passwordProtect forgot-password
Contact uscontact_formProtect contact form
Product reviewcommentProtect product reviews
Send to a friendgeneric_formProtect "send to friend"

All six are on by default. When a check fails, the request is stopped, Magento shows the error message and the visitor is sent back to the form.

Not covered yet: checkout, and the login pop-up used inside checkout.

Requirements ​

  • Magento Open Source or Adobe Commerce 2.4.x
  • PHP 8.1 to 8.4
  • A CaptchaLa account — get your App Key + App Secret at dash.captcha.la

Install ​

  1. Copy the CaptchaLa/ folder from the GitHub repository into app/code/, so the module lands in app/code/CaptchaLa/Captcha/.

  2. From the Magento root, install the PHP SDK and enable the module:

    bash
    composer require captchala/captchala-php
    bin/magento module:enable CaptchaLa_Captcha
    bin/magento setup:upgrade
    bin/magento setup:di:compile
    bin/magento cache:flush

Configure ​

Open Stores → Configuration → Customers → CaptchaLa in the admin:

  1. Set Enable to Yes.
  2. Paste your App Key and App Secret.
  3. Choose a Widget mode and Language, and set the Protect … switches for the forms you want.
  4. Click Save Config, then flush the cache.

The module is off until Enable is set to Yes and both keys are saved. Settings can differ per website or store view.

SettingDefaultDescription
EnableNoMaster switch. When off, CaptchaLa neither renders nor validates.
App Key—Public key from the CaptchaLa dashboard. Required.
App Secret—Server secret, used to issue and validate tokens. Required; stored encrypted and never sent to the browser.
Widget modebindbind (the check runs when the visitor presses the form's submit button), popup, float or embed (a verification bar inside the form).
LanguageautoA BCP-47 tag such as ja or pt-BR, or auto to follow the visitor's browser.
Protect … (six switches)YesOne per form in the table above.
Skip CAPTCHA for logged-in customersYesSigned-in customers are not challenged.

Screenshots ​

CaptchaLa settings under Stores → Configuration → Customers in the Magento admin

Magento contact form with the CaptchaLa bar showing Verified above Submit

Magento customer login form with the CaptchaLa bar showing Verified above Sign In

Notes ​

  • Full-page cache. Protected pages can stay in Magento's full-page cache: the widget fetches a fresh token from your store when the page loads.
  • Content Security Policy. The module adds the CaptchaLa hosts to Magento's CSP whitelist, and its inline scripts carry Magento's CSP nonce, so no CSP changes are needed.

Troubleshooting ​

  • The widget does not appear. Check that Enable is Yes in the scope you are viewing, that both keys are saved, and that the form's Protect … switch is on. Then flush the cache.
  • Every submission is refused. Make sure the App Key and App Secret belong to the same app, and that your store's domain is allowed for that app in the dashboard.
  • Trying it out. The public test keys let you check the full flow without an account.

MIT-licensed examples · CaptchaLa is operated independently