Protect your form from spam and bots by adding Google reCAPTCHA. This guide covers both reCAPTCHA v2 (checkbox) and v3 (invisible) with step-by-step instructions.
Go to the Google reCAPTCHA admin console and register your domain. Choose reCAPTCHA v2 (checkbox) for a visible challenge or v3 (invisible) for a frictionless experience. Google gives you a site key (for the frontend) and a secret key (for server-side verification).
Load the reCAPTCHA script and place the widget inside your form. For v2, add a div with the g-recaptcha class. For v3, the script runs invisibly and attaches a token to your form automatically. The token is sent along with the rest of your form data.
<!-- reCAPTCHA v2 (checkbox) -->
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
<form action="https://formslist.com/f/YOUR_FORM_HASH" method="POST">
<input type="text" name="name" placeholder="Name" required />
<input type="email" name="email" placeholder="Email" required />
<textarea name="message" placeholder="Message" required></textarea>
<div class="g-recaptcha" data-sitekey="YOUR_RECAPTCHA_SITE_KEY"></div>
<button type="submit">Send</button>
</form>If you prefer a frictionless user experience, use reCAPTCHA v3 instead. It scores each visitor from 0.0 (bot) to 1.0 (human) without showing a challenge. The token is generated on form submit and sent to your backend or form endpoint for verification.
<script src="https://www.google.com/recaptcha/api.js?render=YOUR_RECAPTCHA_SITE_KEY"></script>
<form id="contactForm" action="https://formslist.com/f/YOUR_FORM_HASH" method="POST">
<input type="text" name="name" placeholder="Name" required />
<input type="email" name="email" placeholder="Email" required />
<textarea name="message" placeholder="Message" required></textarea>
<input type="hidden" name="g-recaptcha-response" id="recaptchaToken" />
<button type="submit">Send</button>
</form>
<script>
document.getElementById("contactForm").addEventListener("submit", function (e) {
e.preventDefault();
grecaptcha.ready(function () {
grecaptcha.execute("YOUR_RECAPTCHA_SITE_KEY", { action: "submit" }).then(function (token) {
document.getElementById("recaptchaToken").value = token;
e.target.submit();
});
});
});
</script>FormsList can verify reCAPTCHA tokens automatically when you add your secret key in the dashboard. Alternatively, you can verify tokens on your own server by sending them to Google's siteverify API. Test by submitting the form normally and by disabling JavaScript to confirm that bot submissions are blocked.
Stop spam submissions on your website forms using honeypot fields, CAPTCHAs, rate limiting, and AI-powered spam detection. Protect your inbox without hurting real users.
Learn moreAdd a fully functional contact form to any HTML website in under 5 minutes. No JavaScript frameworks, no server setup — just plain HTML that works everywhere.
Learn moreLearn the best practices for validating form data on both the client and server side. Improve user experience, reduce errors, and keep your data clean.
Learn moreSet up your form backend in under a minute. No server required, no complex configuration — just a simple endpoint for your forms.