Add a Google reCAPTCHA checkbox to a form

You can optionally add a Google reCAPTCHA button to your contact form or subscribe form to deter spam. Check out how to get a Google reCaptcha.

Here's an example of the Contact form with a reCAPTCHA checkbox.

To use this feature, you must sign up for the public and secret key pair specifically for the domain on which this site will run. For more information see the Google reCAPTCHA documentation.

Note: reCAPTCHA authentication works only for the domain that you obtained the keys for. If you have your website at a staging location or a local server where the URL does not match your domain name, the reCAPTCHA box will display but show an error until you have moved your site.

Enter the public and secret keys on the reCAPTCHA tab in the Contact Form module or the Subscribe Form module. Once the keys are entered, you can choose whether to show or hide the reCAPTCHA checkbox on your form. If you choose Hide, the box doesn't appear and any reCaptcha credentials you've entered are not checked.