Spam protection
Keep unwanted Submissions out of the Inbox with a hidden field, allowed domains, proof of work and Cloudflare Turnstile, set per Site.
Insane Forms checks every Submission as it arrives. A Submission that fails a check is stored in the Spam tab instead of the Inbox, and it creates no Deliveries. It is not rejected: the Visitor and any bot see the same success answer as for a good Submission. You can read Spam, move a Submission back with "Not spam", or leave it to be deleted after 30 days. See Submissions.
Some checks are per Site. Open the Site's Settings and find the "Spam protection" section. The same section opens from the Spam tab of any Form, with the "Spam protection" button. Owners and Developers can change it. Maintainers cannot.
The checks
A Submission is tested in this order. The first failure decides the reason shown in the app.
- Hidden field: "Filled the hidden field".
- Proof of work: "Failed the bot check".
- Turnstile: "Failed the captcha".
- Allowed domains, links, repeats and rate: "Contains blocked words".
Hidden field
Add an input named _gotcha that real Visitors never see or fill. Bots that fill every input fill it too. Any value in _gotcha sends the Submission to Spam.
<input
type="text"
name="_gotcha"
tabindex="-1"
autocomplete="off"
style="position:absolute;left:-9999px"
aria-hidden="true"
>This check works on every Site and needs no setting.
Allowed domains
List the Site's domains in Site settings, one per line, without https://. A Submission passes only when its Origin header, or its Referer when there is no Origin, is on one of those domains or a subdomain of one. A request with neither header, or from another domain, goes to Spam.
Leave the list empty to accept Submissions from any domain, and this check is skipped.
The Visitor's browser sends these headers, so this check stops bots that post from other sites. It does not stop a script that sets its own headers.
Proof of work
Turn on "Require proof of work" in the Site's Spam protection section. The Visitor's browser solves a small puzzle before it submits, which slows down bulk submissions. It needs the drop-in script or @insane-forms/core on your site. A plain HTML form cannot solve it, so a Submission from one goes to Spam with "Failed the bot check" while the setting is on.
Each puzzle can be used once, and it must be at least two seconds old when the form is sent. The script handles this for you.
Cloudflare Turnstile
Turnstile is Cloudflare's captcha. Create a Turnstile widget in your Cloudflare account, then enter both keys in the Site's Spam protection section under "Turnstile keys":
- "Site key", the public key your page renders.
- "Secret key", which Insane Forms uses to check each answer. The app never shows it again after you save it.
"Remove keys" stops the check. The Submission must carry a valid token, and Cloudflare must report that it was solved on one of the Site's domains. When the Site has no domains, any hostname passes.
The drop-in script renders the widget for you and adds the token. With a plain HTML form, render the widget yourself so the form includes the cf-turnstile-response field.
Links, repeats and rate
These checks need no setting. A Submission goes to Spam with "Contains blocked words" when:
- its fields contain more than 5 links starting with
http://orhttps://, - the same field content arrived on the Form in the last 24 hours and the earlier Submission is in the Inbox or a person moved it to Spam,
- the same address already sent 10 or more Submissions to the Form in the last 10 minutes.
At 50 Submissions in 10 minutes from one address, the endpoint answers 429 and stores nothing.
The duplicate check compares fields in order and skips Submissions with no fields to compare. It ignores case and whitespace at the start or end of each field name and value.
The label "Contains blocked words" covers all of these, including the domain check. It does not mean a word list.
Report spam yourself
"Report spam" moves a Submission from the Inbox to Spam. Submissions you report this way are marked "Marked as spam" and are not deleted by the 30-day cleanup. Sending the same content again goes to Spam as a repeat.