Skip to content
Every tutorial here is 100% free — and always will be
LSLovableStudent

How do I stop bots?

Last checked 31 Aug 2026

Short answer

Add a CAPTCHA (e.g. Cloudflare Turnstile) to public forms, validate inputs server-side, and rate-limit submissions — client-side-only checks like a hidden field are easy for real bots to bypass.

Layered approach

No single measure stops all bots; combine a few:

  • CAPTCHA/challenge on public sign-up, contact, or comment forms — Cloudflare Turnstile or Google reCAPTCHA are common choices your Edge Function can verify server-side.
  • Honeypot fields — an invisible form field real users never fill in; if it's filled, silently reject the submission. Cheap to add, catches unsophisticated bots.
  • Rate limiting per IP/user on submission endpoints (see /questions/how-do-i-rate-limit-an-api).
  • Server-side validation — check email format, field lengths and required fields in the Edge Function, not just in the browser, since a bot can call the endpoint directly.

A prompt that helps

Add Cloudflare Turnstile to the sign-up form, verify the token server-side in the Edge Function before creating the account, and add a honeypot field as a second layer.

What CAPTCHA alone won't fix

A CAPTCHA on the sign-up form doesn't stop abuse of an Edge Function called directly, bypassing the form entirely. The server-side check on submission is what actually matters; the CAPTCHA widget is only useful if its token is verified server-side, not just present in the request.

What usually goes wrong

Adding a CAPTCHA to the front end but never verifying the token in the Edge Function — the check needs to happen where the data lands, not just where the form is displayed. See /questions/how-do-i-prevent-spam-registrations and /questions/how-do-i-rate-limit-an-api for related defences.

Sources

Was this answer helpful?

Related questions

Website made, maintained and hosted by PromptSites.com

PromptSites logo