Set up Cloudflare Turnstile.
Turnstile is Cloudflare’s free CAPTCHA alternative. A small widget runs inside your form, filters out bots, and issues a one-time token that FormPostbox validates before it accepts a submission. Protection is optional per site — an unprotected site saves submissions without the challenge — and you only need a free Cloudflare account; your website does not have to use Cloudflare for anything else.
FormPostbox never creates a Cloudflare Site Key for you. You create a widget in your own Cloudflare account and paste its two keys into FormPostbox, as described below. Turnstile is an independent service that works on any website, with or without Cloudflare’s network — see Cloudflare’s introduction.
What Turnstile does for your form
- It tells people and bots apart, so automated and spam submissions are much less likely to reach your inbox.
- Most visitors pass without noticing. In Managed mode Cloudflare silently decides whether an interaction is needed; it asks for a checkbox only when it wants a closer check, so do not expect a checkbox on every submission.
- The check runs on your own page while the visitor fills in the form — nobody is sent to another website or asked to solve image puzzles.
1. Create a widget in Cloudflare
Open your Cloudflare dashboard → Turnstile (sign up for a free account first if you need one), then select Add widget. Three fields matter:
- Widget name — any label you will recognize later, for example
FormPostbox contact form. - Hostname management — the website that will show the form, for example
www.example.com. Enter a hostname only: nohttps://, no port, and no paths like/contact. Adding a hostname also authorizes its subdomains, but not the parent domain around it; wildcards are not supported. Free accounts can add up to 10 hostnames per widget. - Widget mode — choose Managed (recommended): Cloudflare automatically decides between a silent check and a checkbox based on the visitor’s risk. Non-interactive and invisible modes also exist; Managed is the right default here.
Select Create. Cloudflare then shows the widget’s Site Key and Secret Key — copy both and keep the Secret Key somewhere safe. To find them again later, open the widget and go to Settings.
Official Cloudflare guides: Create and manage widgets (dashboard) and Widget modes. You can skip Pre-clearance — it is for single-page apps and is not needed for the examples here.
2. Know which key goes where
- Site Key — the public half. It goes into the form code on your website; visitors can see it, and that is fine.
- Secret Key — the private half. FormPostbox uses it on its servers to confirm each token with Cloudflare. Never put it in your website’s code, and never paste it into a preview tool, screenshot, or chat.
- Both keys must come from the same widget. A Site Key and a Secret Key from two different widgets will not work together.
3. Save both keys in FormPostbox
In your workspace, open Sites → your site → Settings → Spam protection:
- Turnstile site key — paste the Site Key. Your current key is shown here, so you can always confirm which configuration is active.
- Turnstile secret key — paste the Secret Key. It is stored encrypted. If a secret is already saved, leaving this field blank keeps the existing one; only fill it in when you want to replace it.
Select Save protection. You should see Protection settings saved., and the site switches to Protection on. If it still shows Protection needed, the save did not go through — repeat this step.
Use your widget’s real keys for a live site. The test keys described below are for local development only.
4. Connect your form with AI
Open Forms → your form. Under Connect your website, choose Use AI to connect and give the generated prompt to your AI coding tool. It uses your real endpoint and includes the public Site Key only when protection is enabled. Protection is optional: an unprotected site can generate and use the prompt without Turnstile keys. For manual code, copy the version generated for your form’s protection state; see the manual code examples.
5. Two settings, two different jobs
Most first-time failures come from changing one of these and forgetting the other. They live in different products and answer different questions:
- Cloudflare → widget hostname:
www.example.com— where the widget is allowed to run. Hostname only. - FormPostbox → Allowed origins:
https://www.example.com— which page addresses may submit to your form. Scheme, hostname, and port; no path.
Your form always checks that the page’s origin is on the allowed list. When protection is enabled, the widget must also be allowed to run on that hostname. Updating one does not update the other. The origin guide covers the allowed-origins rules, including subdomains, ports, and preview addresses.
Test keys are for development only
Cloudflare provides separate test Site Keys and test Secret Keys. Their behavior differs: a test Site Key can force an interactive challenge, while a test Secret Key can simulate an already-used token. Follow the full key pairs in the official testing guide ↗, not just a key prefix. Dummy keys apply only when the receiving FormPostbox service itself runs locally with test mode explicitly enabled. A localhost frontend posting to formpostbox.com still uses the hosted service: use a separate test site with a real widget that allows the local hostname, or leave protection off on that test site. Do not save dummy secrets to the hosted service.
If something still fails
A widget that never appears, a rejected check, or a saved-vs-email confusion all have specific fixes: work through the troubleshooting page. You can also review the request rules in the origin guide.
Still need help? Contact support@formpostbox.com. Include the guide topic and redacted error details, without keys or visitor messages.
Browse all topics ↑