FormBackend logo FormBackend logo

Spam

Cloudflare Turnstile

Implement hCaptcha to protect your forms from spam and abuse

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

  • Create an account with hCaptcha to get a sitekey and a secret.
  • Add the hCaptcha script to your form.
  • Update the settings for your given form (the “Settings”-tab) with the hCaptcha sitekey and secret.

Create a hCaptcha site key

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.

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

In order to enable Cloudflare Turnstile for your FormBackend form, head to the settings page for your form and paste the Cloudflare Turnstile sitekey and secret in to the respective fields. This will enable Turnstile for your form submissions, meaning if they come in and the verification doesn’t pass - they will be sent to spam.