hCaptcha

hCaptcha is the privacy friendly alternative to Google reCaptcha. Used by Cloudflare, Shopify & more..

hCaptcha checkbox
hcaptcha solve problem

Web3Forms provides zero-config integration with hCaptcha. You don't need to setup your own keys or register with them. Just use the following code and add a script. You're done.

Remember hCaptcha's captcha mostly feels a bit difficult for users to solve. In that case, you can either use hCaptcha Paid Plan or use alternatives like hidden honeypot (less secure) or reCaptcha / Cloudflare Turnstile Captcha method (Pro).

Step 1: Add a <div> inside your form

Step 2: Add the script before the closing of </body>

Configuration Options

You can provide all options provided by hCaptcha by default. You need to append the option with data-* attribute. See example below

For more configuration options, visit: https://docs.hcaptcha.com/configuration

Activate hCaptcha to your form

Once everything's setup you need to activate hCaptcha on your form to make it mandatory on each form submissions. For that, visit the dashboard: https://app.webforms.com and click on your form and then enable hCaptcha as your preferred captcha

Add Client Side Validation as shown below to prevent form submission without checking the hCaptcha field.

Client Side Validation

Use this snippet if you are using the HTML form-embedded method without Javascript to check whether the hCaptcha is filled or not.

Add this code block just above the closing of </body> and make sure YOUR_FORM_ID is updated with your form id.

Manual Setup

If you want to load hCaptcha directly instead of using web3forms proxy, make sure you use the following sitekey for free plans. You can set your own site key and secret key on all paid plans,

Full Code

If you add just two lines to your contact form, you will get a working hCaptcha to protect your form.

Usage with React / Next.js

To use hCaptcha with React or Next.js, please follow the instructions below.

First, install the @hcaptcha/react-hcaptcha package from NPM.

Then, add the <HCaptcha/> component inside the form.

Make sure you are using 50b2fe65-b00b-4b9e-ad62-3ba471098be2as the sitekey for free plans. Also make sure reCaptchaCompat is false.

You can use a custom site key if you are on a Paid plan.

That's it.

Make sure you have enabled hcaptcha as the Block Spam option in the settings. Login to your dashboard to change it if not enabled already.

Other implementations

You can see the following guide for more examples. Just make sure you are using the correct sitekey as mentioned above. https://www.npmjs.com/package/@hcaptcha/react-hcaptcha

Last updated

Was this helpful?