Adding a CAPTCHA to your forms is a great way to prevent spam and automated submissions. To get started, you need to generate your Google Captcha keys (Site Key and Secret Key) using Google’s reCAPTCHA service.
Follow the steps below to set everything up.
Steps to Generate Google reCAPTCHA Site & Secret Keys:
-
Go to the reCAPTCHA Admin Console:
https://www.google.com/recaptcha/admin - Log in with your Google account.
-
Register a New Site:
- Label: Enter a name to identify your project (e.g., MyWebsite reCAPTCHA).
-
reCAPTCHA Type:
-
reCAPTCHA v2:
- “I’m not a robot” checkbox
- Invisible reCAPTCHA badge
- Android option
-
reCAPTCHA v3:
- Works without user interaction
- Assigns scores based on user behavior
-
reCAPTCHA v2:
- Domains: Add the domain(s) where you’ll use reCAPTCHA (e.g., example.com).
- Owners: Add any additional email addresses if needed.
- Accept the reCAPTCHA Terms of Service.
- (Optional) Enable alerts for suspicious activity.
- Click “Submit.”
You will receive:
- Site Key (Public key – used on the frontend)
- Secret Key (Private key – used for backend verification)
Use these keys to integrate Google reCAPTCHA and secure your forms effectively.