FormBackend logo
← Back to FormBackend

Spam

Cloudflare Turnstile

Implement Cloudflare Turnstile to protect your forms from spam and abuse

These are the required steps for you to set this up:

  • Create a Cloudflare account and add a Turnstile widget to get a sitekey and secret.
  • Add the Turnstile script and widget to your form.
  • Add the Turnstile sitekey and secret on your form’s Settings tab in FormBackend.

Create a Turnstile widget

If you don’t have a Cloudflare account already, go create one on https://www.cloudflare.com. Then log in and add a new Turnstile site, by clicking Turnstile in the sidebar.

Copy the sitekey and secret after creating the widget. Insert the following script tag before the end of your <head> tag:

<script src="https://challenges.cloudflare.com/turnstile/v0/api.js" async defer></script>

Insert the Turnstile div in your form with your sitekey, similar to this:

<form method="POST" action="https://www.formbackend.com/f/your-form-token">
  <input type="text" name="name">
  <div class="cf-turnstile" data-sitekey="your-site-key"></div>
  <input type="submit" value="Submit">
</form>

Add the secret to FormBackend

Open the form in FormBackend, select Settings, and find the Cloudflare Turnstile section. Enable Require Turnstile response, then paste the sitekey and secret into their respective fields and save your changes.

Submissions without a valid Turnstile response are accepted into FormBackend but marked as spam, so you can review them without receiving normal notifications.