Docs

Set up Cloudflare Turnstile

4 min readUpdated November 19, 2026

Turnstile is Cloudflare’s CAPTCHA service. It is free to use and doesn’t require your site to run on Cloudflare. Shield offers it in two modes. You pick one tile:

  • Turnstile (shown): a Cloudflare widget always appears on the form. The tile note reads “Cloudflare managed – widget always shown”.
  • Turnstile (hidden): nothing appears. The check runs in the background when the visitor submits the form. The tile note reads “Cloudflare invisible – runs in background”.

Both modes use the same Cloudflare keys.

Before you start#

You need a Cloudflare account. You do not need to move your DNS to Cloudflare. Turnstile has its own terms, so check Cloudflare’s site for current details.

Step 1: Create a Turnstile widget at Cloudflare#

  1. Sign in to the Cloudflare dashboard and open Turnstile.
  2. Add a new widget and give it a name.
  3. Add your site’s domain.
  4. Choose the widget mode. Choose Managed for the shown tile, or Invisible for the hidden tile.
  5. Create it, then copy the Site key and Secret key.

Step 2: Add the keys to Shield#

  1. Go to Settings → Login Shield and open the Widget tab.
  2. Click Turnstile (shown) or Turnstile (hidden).
  3. Paste the Site key.
  4. Paste the Secret key. After you save, the field stays blank and shows “Secret key is set”. Leave it blank to keep the saved key.
  5. Click Save widget settings.

Keys are stored in the WordPress options table.

A settings menu for a CAPTCHA verification provider shows eight options, with OOPSpam currently selected. Below the provider cards are text fields for a site key and secret key, followed by radio buttons to set when the challenge is shown and a “Save widget settings” button.

Step 3: Choose when to show the challenge#

Show challenge has two options:

  • Always (all visitors): every visitor goes through Turnstile.
  • Only after first failed attempt: visitors log in normally until their first failed attempt.

The score threshold field does not appear for Turnstile. It applies only to reCAPTCHA v3.

Step 4: Test it#

  1. Open a private window and go to your login page.
  2. With the shown tile, the Cloudflare widget appears above the submit button. With the hidden tile, you see nothing, and the check runs when you click the login button.
  3. Log in as a test user.

You can also use the Live preview on the Widget tab. Save first if you just changed the key.

Which mode should I use?#

  • Shown is the simplest to troubleshoot, because visitors and you can see that it loaded.
  • Hidden has no visual change to your login page, but you can’t tell at a glance whether the check ran. If a hidden check ever fails, switch to the shown tile temporarily to see what happens.

Where it’s used#

Turnstile protects the login form and the other forms Shield covers, such as registration and lost password, when those are turned on.

If Cloudflare can’t be reached#

Shield fails open. If Cloudflare’s verification service is unreachable or returns an unreadable reply, the login goes through. Your other protections keep working: lockout, blocklists, honeypot usernames and 2FA.

If the check itself fails, the visitor sees “CAPTCHA verification failed. Please try again.”

Turnstile versus Shield’s Cloudflare edge blocking#

These are two different features that share a vendor. Turnstile is a CAPTCHA on your forms and needs only a Turnstile widget. Edge blocking (a separate topic) pushes blocks into your Cloudflare firewall and needs a Cloudflare account that handles your site’s traffic. You can use either one without the other.

Privacy#

Turnstile loads a script from Cloudflare and sends Cloudflare information about the visitor’s browser and visit. Name Cloudflare Turnstile in your privacy policy and cookie notice. If you use a cookie banner, you may need consent before the script loads. Check your own legal requirements.

Troubleshooting#

  • The widget doesn’t appear (shown mode): check that the site key is saved, the domain is added to the widget at Cloudflare, and you picked a Turnstile tile.
  • Every login fails: the secret key is wrong. Paste it again.
  • The hidden mode seems to do nothing: that is normal when it works. Check the Log tab for failures, or switch to the shown tile to see it.
  • A caching plugin serves a stale login page: exclude the login page from caching. See the caching docs under Troubleshooting.

Was this helpful?

This website uses cookies to enhance your browsing experience and ensure the site functions properly. By continuing to use this site, you acknowledge and accept our use of cookies.

Accept All Accept Required Only