Steps to Get reCAPTCHA v2/v3 Keys:
- Go to the reCAPTCHA Admin Console:
👉 https://www.google.com/recaptcha/admin
(Sign in with your Google account if prompted.) - Register a New Site:
- Click “+” (Create) or “Register a new site”.
- Fill in the required details:
- Label: A name for your site (e.g., “My Website”).
- reCAPTCHA type: Choose between:
- reCAPTCHA v2 (“I’m not a robot” Checkbox or Invisible reCAPTCHA)
- reCAPTCHA v3 (Returns a score, no user interaction)
- Domains: Add your website domain (e.g.,
example.com).
(For testing, you can uselocalhostor127.0.0.1if working locally.)
- Accept the reCAPTCHA Terms of Service.
- Click Submit.
- Get Your Keys:
- After submission, you’ll see:
- Site Key (Public key, used in your HTML/JS)
- Secret Key (Private key, used for server-side verification)
- Copy both keys and store them securely.
- After submission, you’ll see:
Important Notes:
- Keep Secret Key Private: Never expose it in client-side code.
- Restrict Keys (Optional): In the admin panel, you can restrict keys to specific domains/IPs.
- Testing Locally: Use
localhostas a domain if testing on your PC.
Where to Use the Keys?
- Frontend (HTML/JS): Include the Site Key in your reCAPTCHA widget.
- Backend (PHP/Node.js/Python/etc.): Use the Secret Key to verify user responses.