Skip to main content

Protect the form from spam

What it does​

Google reCAPTCHA checks that a person, not a script, sends the price request form. You turn it on in Magento's own reCAPTCHA settings: Stores → Configuration → Security → Google reCAPTCHA Storefront.

Before you start​

  • The price request form is turned on. See Set up the price request form.
  • You have a Google reCAPTCHA site key and secret key, and you entered them for the reCAPTCHA type you want to use in Stores → Configuration → Security → Google reCAPTCHA Storefront. Google issues the keys in its reCAPTCHA admin console.
  • On Hyvä, the HidePrice Pro companion module is version 2.1.1 or later.

Steps​

Turn on reCAPTCHA for the form​

  1. Go to Stores → Configuration → Security → Google reCAPTCHA Storefront.

  2. Expand Storefront.

  3. In Enable for HidePrice Request Form, clear Use system value, then select the reCAPTCHA type:

    • reCAPTCHA v2 ("I am not a robot"): the customer selects a checkbox and sometimes solves a picture puzzle.
    • reCAPTCHA v2 Invisible: no checkbox. Google checks the visitor in the background and shows a puzzle only when in doubt.
    • reCAPTCHA v3 Invisible: no checkbox and no puzzle. Google scores the visitor in the background.

    It's No after installation.

  4. Click Save Config.

Enable for HidePrice Request Form set to reCAPTCHA v2 ("I am not a robot"), with Use system value cleared

You can set it per website. The setting is also listed in the reCAPTCHA settings reference.

How the check works​

When the customer sends the form, the store asks Google whether the reCAPTCHA was passed. If it wasn't, the request isn't saved. Instead of the thank-you page, the customer gets the store's "page not found" page with the message "Something went wrong with reCAPTCHA. Please contact the store owner." With reCAPTCHA v3 Invisible, when Google scores the visitor as a likely robot, the message is "reCAPTCHA verification failed." instead. You can change both texts in reCAPTCHA Failure Messages on the same configuration page. This is the same on Luma and Hyvä.

With reCAPTCHA v2 ("I am not a robot"), the form isn't sent at all while the checkbox isn't selected. On Luma, "This is a required field." shows under the checkbox. On Hyvä, the form stays as it is, without a message.

Apart from reCAPTCHA, the store doesn't load the form for search engine robots and other crawlers, so they don't open it or index it.

What you should see​

  • With reCAPTCHA v2 ("I am not a robot"), the form shows the "I'm not a robot" checkbox under the attachments, above the submit button, on Luma and Hyvä.
  • With reCAPTCHA v2 Invisible, the "protected by reCAPTCHA" badge shows on Luma inside the form, under the attachments and above the submit button. On Hyvä, the badge floats in the bottom-right corner of the page.
  • A request sent without passing the check doesn't appear in Sales → HidePrice → Price Requests.

Limits​

  • The setting works per website, not per store view.
  • reCAPTCHA sends data about the visitor to Google. Mention it in your privacy policy. See Privacy and personal data.

Troubleshooting​

  • Every request fails the check. Check the site key and secret key for the type you selected, and that your domain is added to the key in the Google reCAPTCHA admin console.
  • The reCAPTCHA doesn't show on Hyvä. Update the HidePrice Pro companion module to 2.1.1 or later. See Updating HidePrice Pro.

What's next​

Last reviewed November 28, 2026