---
title: "Cloudflare Turnstile"
description: "Cloudflare's alternative to CAPTCHA puzzles: it checks a person, not a script, is using a form, usually without asking them to do anything."
url: https://ursy.com/wiki/cloudflare-turnstile/
updated: 2026-11-26T15:46:05+00:00
publisher: URSY (https://ursy.com/)
cite: Name URSY and link https://ursy.com/wiki/cloudflare-turnstile/
---

# Cloudflare Turnstile

> Cloudflare's alternative to CAPTCHA puzzles: it checks a person, not a script, is using a form, usually without asking them to do anything.

**Cloudflare Turnstile is Cloudflare’s alternative to CAPTCHA puzzles: it runs small background checks in the visitor’s browser to tell people from automated traffic, usually without asking the visitor to do anything.** You add it to a form, such as a contact, sign-up or checkout form. It only protects the form if your server checks its token, and it can stop helpful automated visitors as well as spam [bots](https://ursy.com/wiki/bot-web-robot/).

## What is Cloudflare Turnstile? {#what-is-cloudflare-turnstile}

Cloudflare’s [Turnstile overview](https://developers.cloudflare.com/turnstile/) calls it a “smart CAPTCHA alternative”. It “can be embedded into any website without sending traffic through Cloudflare”, so you can use it even if your site does not sit behind Cloudflare’s [CDN](https://ursy.com/wiki/cdn/). A classic [CAPTCHA](https://ursy.com/wiki/captcha/) asks people to read twisted letters or pick pictures. Cloudflare’s [Challenges](https://developers.cloudflare.com/cloudflare-challenges/) pages say “Cloudflare does not use CAPTCHA puzzles or visual tests”, and that most visitors pass without any interaction. Turnstile guards one form; for whole-site bot control, see [bot score](https://ursy.com/wiki/bot-score/), [Super Bot Fight Mode](https://ursy.com/wiki/super-bot-fight-mode/) and [Under Attack mode](https://ursy.com/wiki/under-attack-mode/).

## Why not just use a CAPTCHA? {#why-not-just-use-a-captcha}

Puzzles stop some bots but shut out real people and spoil the [user experience](https://ursy.com/wiki/user-experience-ux/). The W3C note [Inaccessibility of CAPTCHA](https://www.w3.org/TR/turingtest/) (a Group Draft Note, December 2021) says CAPTCHA “often prevents people with disabilities from performing the requested procedure”. Blind and visually impaired users are asked to do the task they are least able to do. Cloudflare’s overview says “Turnstile is WCAG 2.2 AA compliant”. Still test it yourself; see [web accessibility](https://ursy.com/wiki/web-accessibility/).

## Which widget types are there? {#which-widget-types-are-there}

Cloudflare’s [widget](https://developers.cloudflare.com/turnstile/concepts/widget/) page lists three modes:

| Mode | What the visitor sees |
| --- | --- |
| Managed (recommended) | “Automatically chooses between non-interactive or checkbox challenge based on visitor risk level.” |
| Non-interactive | a visible widget with a loading spinner; no click needed |
| Invisible | nothing: “Runs challenges completely in the background” |

The same family of checks sits behind Cloudflare’s [managed challenge](https://ursy.com/wiki/managed-challenge/), which protects whole pages rather than one form.

## What does it cost? {#what-does-it-cost}

Cloudflare’s [plans](https://developers.cloudflare.com/turnstile/plans/) page lists a Free plan with up to 20 widgets and 10 [hostnames](https://ursy.com/wiki/hostname/) per widget, and 7 days of analytics. Enterprise has unlimited widgets, up to 200 hostnames per widget and 30 days of analytics. Cloudflare says neither plan limits challenges. Turnstile Analytics shows how many challenges were issued and the solve rate.

## A worked example {#a-worked-example}

A law firm adds Turnstile to its enquiry form. Cloudflare’s [client-side rendering](https://developers.cloudflare.com/turnstile/get-started/client-side-rendering/) guide shows two parts for the page. The script:

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

And, inside the form, the widget:

```
<div class="cf-turnstile" data-sitekey="<YOUR-SITE-KEY>"></div>
```

This is “implicit” [rendering](https://ursy.com/wiki/rendering/): the script finds the box when the page loads. Pages that build forms later use “explicit” rendering with `turnstile.render()`. Cloudflare warns: “Proxying or [caching](https://ursy.com/wiki/caching/) this file will cause Turnstile to fail when future updates are released.” Load `api.js` from Cloudflare’s own address.

When a visitor passes, the widget puts a token in a hidden field named `cf-turnstile-response`. The firm’s server must then send that token, with its secret key, to the Siteverify API:

```
POST https://challenges.cloudflare.com/turnstile/v0/siteverify
secret=<YOUR-SECRET-KEY>&response=<TOKEN>
```

Cloudflare’s [server-side validation](https://developers.cloudflare.com/turnstile/get-started/server-side-validation/) guide is firm: “Server-side validation is mandatory.” Without it, the widget alone does not protect the form, because an attacker can post any string as a token.

## What should the server check? {#what-should-the-server-check}

- **Time.**  Each token lasts 300 seconds (5 minutes). An expired token needs a fresh widget, for example with `turnstile.reset`.
- **Once only.**  A token is for one validation. A reused one fails with `timeout-or-duplicate`.
- **Size.**  A token can be up to 2048 characters, so do not cut the field short.
- **The answer.**  The reply holds `success`, `challenge_ts`, `hostname`, `error-codes`, `action` and `cdata`. Check that `hostname` is your site.
- **Retries.**  An optional `idempotency_key` makes a retry safe. An optional `remoteip` passes the visitor’s address.

## How do I test it? {#how-do-i-test-it}

Cloudflare’s [testing](https://developers.cloudflare.com/turnstile/troubleshooting/testing/) page gives dummy keys. The site key `1x00000000000000000000AA` always passes, `2x00000000000000000000AB` always fails, and `3x00000000000000000000FF` forces an interactive challenge. The secret key `1x0000000000000000000000000000000AA` always passes validation. Cloudflare says “Production secret keys will reject the dummy token”. Swap in your real keys before you go live, and do not let your real site key allow local domains.

## Where should it go? {#where-should-it-go}

Put it where automated sending does harm, and nowhere else:

- **Contact and quote forms**  on a [landing page](https://ursy.com/wiki/landing-page/), where spam buries real enquiries.
- **Comments and reviews** , the [user-generated content](https://ursy.com/wiki/user-generated-content/) that spammers fill with links.
- **Sign-up and sign-in** , where bots try lists of addresses.
- **Single-page apps.**  Cloudflare’s overview says Turnstile can issue a Pre-Clearance [cookie](https://ursy.com/wiki/cookie/) for them. Its challenge pages guide suggests this for background ([AJAX](https://ursy.com/wiki/ajax/) or fetch) requests, where a full challenge page fails.

Leave it off pages people only read. Each extra check is one more step between a visitor and your [call to action](https://ursy.com/wiki/call-to-action/). Count form sends with [conversion tracking](https://ursy.com/wiki/conversion-tracking/) before and after, so you can see if real people are being stopped.

## Why does it matter for search? {#why-does-it-matter-for-search}

Turnstile protects a form, not a page. A [search crawler](https://ursy.com/wiki/search-crawler/) such as [Googlebot](https://ursy.com/wiki/googlebot/) still reads the page around it. The risks are indirect. A slow third-party script can hurt [page speed](https://ursy.com/wiki/page-speed/). A form that real people cannot send hurts your [conversion rate](https://ursy.com/wiki/conversion-rate/). And a strict [WAF](https://ursy.com/wiki/web-application-firewall/) or bot rule is a different thing from Turnstile; that is where crawlers get blocked. See [Bot Fight Mode](https://ursy.com/wiki/cloudflare-bot-fight-mode/).

## Why does it matter for AI answers? {#why-does-it-matter-for-ai-answers}

An [AI agent](https://ursy.com/wiki/ai-agent/) may try to fill in a form for a person: book a call, ask for a quote, place an order. Turnstile exists to stop automated form use, so it may stop that agent too. If you want agents to act, give them a proper route, such as an [MCP](https://ursy.com/wiki/mcp/) server or an API, alongside the protected form. See [agentic commerce](https://ursy.com/wiki/agentic-commerce/) and [the agentic web](https://ursy.com/wiki/agentic-web/). Forms are also where planted text arrives; see [prompt injection](https://ursy.com/wiki/prompt-injection/).

## Common mistakes {#common-mistakes}

- Adding the widget but never checking the token on the server.
- Putting the secret key in the page’s [HTML](https://ursy.com/wiki/html/). Only the site key belongs there.
- Reusing a token, or checking it after more than 5 minutes, then wondering why real enquiries fail.
- Caching or proxying `api.js`.
- A Content Security Policy that blocks it. Cloudflare’s [CSP page](https://developers.cloudflare.com/turnstile/reference/content-security-policy/) says `script-src` and `frame-src` must allow `https://challenges.cloudflare.com`.
- Going live with test keys.

## How to check it {#how-to-check-it}

1. See whether a page uses it. The [Tracking Checker](https://ursy.com/tracking-checker/) lists every script a page loads; look for `challenges.cloudflare.com`. The [tech stack checker](https://ursy.com/tech-stack-checker/) shows what the site is built with.
2. Check the headers with the [Security Headers Checker](https://ursy.com/security-headers-checker/): your Content Security Policy must allow `challenges.cloudflare.com` for scripts and frames. The [HTTP Header Checker](https://ursy.com/http-header-checker/) shows the raw headers.
3. Check what the page sets before consent with the [Cookie Checker](https://ursy.com/cookie-checker/), and your notice with the [UK Shop Compliance Checker](https://ursy.com/uk-shop-compliance-checker/). See [cookie banner](https://ursy.com/wiki/cookie-banner/), [PECR](https://ursy.com/wiki/pecr/) and [UK GDPR](https://ursy.com/wiki/uk-gdpr/).
4. Run the [JavaScript SEO Checker](https://ursy.com/javascript-seo-checker/) to see what a visitor without JavaScript gets: the form should still explain how else to reach you. See [JavaScript SEO](https://ursy.com/wiki/javascript-seo/).
5. Run the [SEO Checker](https://ursy.com/seo-checker/) and the [Meta Tag Checker](https://ursy.com/meta-tag-checker/) on the form page after adding the widget, so nothing else broke.
6. Run the [Prompt Injection Checker](https://ursy.com/prompt-injection-checker/) on pages that show what people send, such as reviews.
7. Run [AI Agent Readiness](https://ursy.com/agent-readiness-checker/) to see whether agents have a route that is not the protected form, and the [AI Readiness Checker](https://ursy.com/ai-readiness-checker/) for the whole site.
8. On WordPress, the [WordPress Security Checker](https://ursy.com/wordpress-security-checker/) looks for open user lists and APIs that a form widget does not cover.
9. Test the form yourself on a phone and with a screen reader. Check the form’s colours with the [colour contrast checker](https://ursy.com/webmaster-tools/colour-contrast-checker/).
10. Send a test with a dummy key, then with your real keys, and confirm your server rejects a made-up token.

Single checks on each tool page: free, no account (2 a day). The full audit: a free account (sign in with an emailed code), 1 a day. In URSY Pro, opening in stages: the [prompt injection guard](https://ursy.com/pro/prompt-injection-guard/) and [events and goals](https://ursy.com/pro/events-and-goals/) for form sign-ups.

## What URSY.com counts {#what-ursy-counts}

We count people through a cookie-free counter that runs in the browser, so bots that do not run scripts never make page views. A browser that tells us it is automated is an AI agent; today only named agents in the edge log are counted, and the page-counter check comes later. We never keep what people type. See our [methodology](https://ursy.com/methodology/).

## Questions {#questions}

### Is Turnstile free? {#is-turnstile-free}

Cloudflare lists a Free plan with up to 20 widgets and no limit on challenges. Enterprise is priced on request.

### Do I need Cloudflare’s CDN to use it? {#do-i-need-cloudflares-cdn-to-use-it}

No. Cloudflare says it can be embedded into any website without sending traffic through Cloudflare.

### Does Turnstile read my form? {#does-turnstile-read-my-form}

Cloudflare says it “does not access, store, or transmit user communications, form entries, or other page inputs”.

### Which widget mode should I choose? {#which-widget-mode-should-i-choose}

Managed, unless you have a reason not to. Cloudflare recommends it: it shows a checkbox only when a visitor looks risky, so most people never click anything.

### Can I try it without breaking my live form? {#can-i-try-it-without-breaking-my-live-form}

Yes. Use Cloudflare’s dummy site key and secret key on a test copy first. They work on any domain, including localhost.

### Why do real enquiries fail? {#why-do-real-enquiries-fail}

Usually an expired or reused token, a blocked script, or test keys left in place.

### Will it stop Google reading my page? {#will-it-stop-google-reading-my-page}

No. It protects the form. Crawl blocks come from firewall and bot rules instead.

## Related words {#related-words}

- [CAPTCHA](https://ursy.com/wiki/captcha/)
- [Managed challenge](https://ursy.com/wiki/managed-challenge/)
- [Web accessibility](https://ursy.com/wiki/web-accessibility/)
- [Under Attack mode](https://ursy.com/wiki/under-attack-mode/)
- [Super Bot Fight Mode](https://ursy.com/wiki/super-bot-fight-mode/)
- [Bot score](https://ursy.com/wiki/bot-score/)
- [Web application firewall](https://ursy.com/wiki/web-application-firewall/)
- [AI agent](https://ursy.com/wiki/ai-agent/)

## Sources {#sources}

- [Cloudflare Docs: Turnstile](https://developers.cloudflare.com/turnstile/), checked 24 November 2026
- [Cloudflare Docs: Turnstile client-side rendering](https://developers.cloudflare.com/turnstile/get-started/client-side-rendering/), checked 24 November 2026
- [Cloudflare Docs: Turnstile server-side validation](https://developers.cloudflare.com/turnstile/get-started/server-side-validation/), checked 24 November 2026
- [Cloudflare Docs: Turnstile widgets](https://developers.cloudflare.com/turnstile/concepts/widget/), checked 24 November 2026
- [Cloudflare Docs: Turnstile plans](https://developers.cloudflare.com/turnstile/plans/), checked 24 November 2026
- [Cloudflare Docs: Turnstile testing](https://developers.cloudflare.com/turnstile/troubleshooting/testing/), checked 24 November 2026
- [Cloudflare Docs: Turnstile Content Security Policy](https://developers.cloudflare.com/turnstile/reference/content-security-policy/), checked 24 November 2026
- [Cloudflare Docs: Challenges](https://developers.cloudflare.com/cloudflare-challenges/), checked 24 November 2026
- [W3C: Inaccessibility of CAPTCHA](https://www.w3.org/TR/turingtest/), checked 24 November 2026

*Updated 24 November 2026 by URSY.com.*
