Skip to content

How to Add Cloudflare Turnstile CAPTCHA in WordPress Form?

Key Takeaways

  • Nexter Blocks Form block adds Cloudflare Turnstile CAPTCHA to a WordPress form, and Cloudflare Turnstile silently verifies users without click boxes or puzzles.
  • Cloudflare Turnstile setup requires a Site Key and Secret Key from Cloudflare Turnstile, where the user goes to Turnstile, clicks Add Widget, adds a widget name, adds hostnames, and creates the widget.
  • Form block security uses the Security Code field and the Security Options dropdown set to Cloudflare, then the Site Key and Secret Key are entered in the Cloudflare Client Key and Cloudflare Secret Key fields.
Table of Contents

Cloudflare Turnstile checks that a visitor is human, usually without making them solve a puzzle.

The Form block in Nexter Blocks Pro adds Turnstile through its Security Code field.

For every Form setting in one place, see the Form block guide.

Before You Start

  • Edition: Pro — The Security Code field needs Nexter Blocks Pro.
  • Block to enable: Form, switched on under Nexter > Blocks in your WordPress dashboard.
  • A Turnstile Site Key and Secret Key: add a Turnstile widget for your domain in the Cloudflare dashboard. See Cloudflare’s Turnstile get-started guide.

Steps

  1. Add the Form block and set up your fields.
  1. Click the + inside the form and add the Security Code field above the Submit button.
  1. With Security Code selected, set Security Options to Cloudflare.
  1. Paste the Site Key into Cloudflare Client Key and the Secret Key into Cloudflare Secret Key. Save.
The Security Code field with Cloudflare Client Key and Cloudflare Secret Key

How It Behaves

  • The Turnstile widget loads with the form. Most visitors pass without clicking anything.
  • On submit, the token is checked with Cloudflare using your Secret Key. Only verified submissions run the form actions.

Limitations

  • Pro only.
  • The keys are set per form. Add them again for each form that uses Turnstile.
  • The widget only works on the hostnames you added to it in Cloudflare.

Troubleshooting

Visitors see “Cloudflare Turnstile validation failed”

The Secret Key does not match the Site Key, or your domain is missing from the widget’s hostnames in Cloudflare.

The widget does not appear

Check the Site Key is in Cloudflare Client Key and clear any page cache.

Related Docs

Share your Thoughts

Still in Doubt? Let’s Assist You

Have Feedback or Questions?

Join our WordPress Community on Facebook!