Black Friday

30% off premium pluginsEnds 2 December

Shop the sale

Blog

/ ·

How to Add Cloudflare Turnstile to WordPress Forms (Free)

Cloudflare Turnstile is a free CAPTCHA service. It checks whether a visitor is human in the background, so most people never see a puzzle. At most they tick one box. Your site does not need to use Cloudflare’s DNS or proxy: Turnstile works on any website, whoever hosts it.

This guide shows you how to add Turnstile to your WordPress login, registration, comment, WooCommerce and contact forms with the free plugin, Simple CAPTCHA with Cloudflare Turnstile created by RelyWP founder, Elliot Sowersby.

The plugin is active on over 200,000 sites, and setup takes about 5 minutes.

In this guide

What you need

  • A free Cloudflare account. Sign up here if you do not have one. You do not need to add your domain to Cloudflare.
  • Admin access to your WordPress site, so you can install a plugin.

Both are free. Cloudflare’s free Turnstile plan allows up to 20 widgets, 10 hostnames per widget and unlimited challenges. The plugin has no paid version.

Prefer to watch?

Step 1: Create a Turnstile widget in Cloudflare

Log in to the Cloudflare dashboard and open Turnstile. You will find it in the left menu under Application security. Then click Add widget manually at the top right.

The Turnstile widgets page in the Cloudflare dashboard with the Add widget manually button at the top right
The Turnstile page in the Cloudflare dashboard.

The blue Set up with Spin button is for developers who add Turnstile to their own code with an AI coding agent. You can ignore it when you use a plugin.

The Add Widget form has three sections to fill in:

  • Widget name: anything that helps you recognise the widget later, such as your site name.
  • Hostname Management: the domain your forms are on. Add every version the widget will load on, including www and any staging domain. You can add up to 10. A missing hostname is the most common cause of a widget that shows up while every form submission fails.
  • Widget Mode: keep Managed, which Cloudflare recommends. Cloudflare then decides how to check each visitor. Most visitors pass without clicking anything, and visitors who look risky get an extra challenge. Non-interactive shows a loading spinner and never asks for a click. Invisible runs the check with nothing shown on the page.
The Add Widget form in the Cloudflare dashboard with a widget name, two hostnames and the Managed widget mode selected
The Add Widget form with two hostnames and Managed mode.

Below the widget mode there is a section called Skip future security rule challenges for verified visitors. This is pre-clearance, and it only works when your site is proxied through Cloudflare. You can leave it switched off.

Click Create. Cloudflare now shows a Site key and a Secret key. Click either key to copy it.

The Cloudflare dashboard after creating a Turnstile widget, showing the Site key and Secret key fields
The keys appear on the right after you create the widget. The secret key is hidden in this screenshot.

The site key is public and appears in your page source. The secret key is private, so do not share it. Cloudflare lets you view both keys again later, but keeping this page open makes the next steps quicker.

Step 2: Install the plugin

In your WordPress admin, go to Plugins › Add Plugin and search for “Simple CAPTCHA with Cloudflare Turnstile”. Click Install Now, then Activate.

Once the plugin is active, go to Settings › Cloudflare Turnstile. The page has three tabs: Settings, Analytics and Import. Everything in this guide happens on the Settings tab.

Step 3: Add your keys

Under API Key Settings, paste the two keys from Cloudflare into the Site Key and Secret Key fields. The secret key is hidden as you paste it, and the View button reveals it if you want to check it. Then click Save Changes.

The API Key Settings section of the plugin with the Site Key field, the hidden Secret Key field and its View button, and the optional wp-config.php link
Paste the two keys into the API Key Settings section.

If you would rather not store the keys in the database, you can define them in wp-config.php instead. There is a link for this under the key fields.

Step 4: Test the API response

After you save new keys, an Almost done box appears at the top of the settings page. Complete the Turnstile check inside it and click TEST RESPONSE. This sends a real check to Cloudflare with your secret key, so it confirms that both keys work together.

The plugin settings page after saving new keys, with an Almost done box asking you to test the Turnstile API response, a completed Turnstile check and a green TEST RESPONSE button
The test box that appears after you save new keys.

When the test passes, the page shows a green message: “Success! Turnstile is working correctly with your API keys.”

The Simple CAPTCHA with Cloudflare Turnstile settings page with the Site Key and Secret Key fields and a green success message after the keys were tested
The API Key Settings section after a successful test.

Turnstile will not appear on any of your forms until this test passes. The plugin works this way on purpose, because a wrong secret key would block every real submission on your site. If the test fails, the error message tells you why. In most cases the secret key is wrong or a hostname is missing from your Cloudflare widget. The test the API response guide explains each error.

Step 5: Choose which forms to protect

Turnstile is off on every form until you turn it on. Scroll down to Enable Turnstile on your forms. The first panel, Default WordPress Forms, covers the login, registration, password reset and comment forms. Below it there is one panel for each supported plugin that is active on your site.

The Enable Turnstile on your forms section, with the Default WordPress Forms panel open and panels for WooCommerce, WPForms, Fluent Forms, Elementor Forms and MailPoet below it
One panel per integration. This test site has WooCommerce, WPForms, Fluent Forms, Elementor and MailPoet active.

Open each panel, tick the forms you want to protect, and click Save Changes again.

If you run a store, open the WooCommerce Forms panel. It has a few extra options for the checkout:

  • Guest Checkout Only: only show the check to customers who are not logged in.
  • Widget Location: where the widget appears on the checkout. The choices are Before Payment, After Payment, Before Pay Button, Before Billing and After Billing.
  • Payment Methods to Skip: payment methods that should not run the check. Express checkout buttons such as PayPal, Google Pay and Apple Pay are skipped automatically, because Turnstile cannot check them.
The WooCommerce Forms panel with checkboxes for login, register, reset password, account details, checkout and pay for order, plus the Guest Checkout Only and Widget Location options
The WooCommerce Forms panel.

Other panels have their own options:

  • The WordPress login and registration rows can be limited to the default wp-login.php page.
  • The WPForms and Fluent Forms panels have a Disabled Form IDs field, which takes a comma-separated list of forms to skip
  • WPForms also has its own CAPTCHA settings, so enable Turnstile either there or in this plugin and not in both.

For more detail, see choose which forms are protected and WooCommerce forms and checkout.

Step 6: Check one of your forms

Open one of the forms you protected in a private browser window, so you see it as a visitor would. The widget loads a moment after the rest of the form and should change to “Success!” within a few seconds.

The WordPress login form with the Cloudflare Turnstile widget showing Success above the Log In button
Turnstile on the WordPress login form.

Then submit the form once to confirm that it goes through.

Settings you may want to change

The defaults suit most sites. These are the settings people change most often.

Widget appearance

Under General Settings you can set the Theme to Light, Dark or Auto, and choose the widget Language.

The General Settings section with the Theme and Language dropdowns and the Disable Submit Button checkbox
The General Settings section.

The Advanced Settings panel adds Widget Size, with a 300px normal size, a full-width size and a 150px compact size. It also has Appearance Mode. If you set this to Interaction Only, the widget stays hidden unless Cloudflare needs the visitor to click.

The Advanced Settings panel with the Widget Size, Appearance Mode, Refresh Timeout and Show Widget Label Text options
The top of the Advanced Settings panel.

See change the widget’s appearance.

Disable Submit Button, also under General Settings, greys out the submit button until the check is complete. The disable the submit button guide covers it.

Whitelist

The Whitelist Settings panel lets some visitors skip the check. You can whitelist logged-in users, IP addresses and user agents, for example the user agent of an uptime monitor. Since version 1.42.0 the IP field also accepts CIDR ranges such as 203.0.113.0/24, so you can whitelist a whole office network. The plugin warns that whitelisting logged-in users lets anyone who gets into an account avoid the check. More in whitelist visitors from the Turnstile challenge.

The Whitelist Settings panel with the Logged In Users checkbox and the IP Addresses and User Agents fields
The Whitelist Settings panel.

Failsafe mode

Failsafe mode decides what happens if your server cannot reach Cloudflare. You can allow submissions without the check, or fall back to Google reCAPTCHA v2, which needs its own keys. It is off by default. See keep forms working when Cloudflare is unreachable.

Analytics

The Analytics tab is off until you enable it. After that it counts how many checks passed and failed on each form and lists the reasons for failures, so you can see which forms bots are targeting. The same tab holds the debug log. See analytics and debug logging.

The Analytics tab, showing the Turnstile Analytics Settings card with checkboxes for analytics and debug logging, an overview of total checks, verified, blocked and retries with a verification rate bar, a Form Analytics table listing forms with their success rates, and Blocked Reasons chips.
The Analytics tab.

Which forms are supported?

  • WordPress: login, registration, password reset and comments.
  • WooCommerce: checkout (classic and block), pay for order, account details, login, registration and password reset. CheckoutWC and Flux Checkout are supported too.
  • Form plugins: WPForms, Fluent Forms, Contact Form 7, Gravity Forms, Formidable Forms, Forminator, Jetpack Forms, Kadence Forms, SureForms and Elementor Pro Forms, including the newer Elementor Atomic forms.
  • Membership and community: MemberPress, Paid Memberships Pro, Ultimate Member, WP-Members, WP User Manager, WP User Frontend, Simple Membership, BuddyPress, bbPress and wpDiscuz.
  • Other: Easy Digital Downloads, Mailchimp for WordPress, MailPoet and Sunshine Photo Cart.

The plugin also works with WordPress Multisite and with most two-factor login plugins. Recent versions added support for passkeys in Wordfence Login Security and for two-factor login in FluentAuth 3.0.

The supported forms and plugins page has the full list. For a form that is not on it, a developer can add Turnstile to a custom form with the plugin’s two helper functions. One function shows the widget and the other checks the result.

If the widget does not appear

Check these three things first:

  1. The API test has not passed. Turnstile stays off until it does, and WordPress shows an admin notice about it.
  2. You are whitelisted. If logged-in users are whitelisted, you will not see the widget as an admin. Check the form in a private window.
  3. An optimisation plugin is delaying scripts. Delaying or combining JavaScript can stop the Turnstile script from loading. The plugin adds exclusions for WP Rocket, LiteSpeed Cache, Autoptimize, Perfmatters and SiteGround Optimizer automatically. For other plugins, see caching and optimisation plugins.

If the widget appears but submissions fail with “Please verify that you are human”, see submissions fail verification. The widget not appearing guide covers the less common causes, and Turnstile error codes explained lists the codes you may see in the browser console.

Turnstile or reCAPTCHA?

Most of the time, Turnstile does not ask visitors to do anything. When it does, the visitor ticks a single checkbox and never has to pick out traffic lights. This matters most on checkout and login forms, where a failed challenge can cost you an order.

Privacy is the other difference. Cloudflare says Turnstile does not use cookies to collect information and does not harvest data for ad retargeting. Verification still sends the visitor’s IP address to Cloudflare, so you should mention Cloudflare in your privacy policy. The privacy and GDPR guide has the details.

If you run a WooCommerce store, our guide to stopping spam orders, fake accounts and card testing compares Turnstile and reCAPTCHA in more detail, along with the other steps that help.

Frequently asked questions

Is Cloudflare Turnstile free?

Yes. Cloudflare’s free plan includes up to 20 widgets, 10 hostnames per widget and unlimited challenges. The paid Enterprise plan raises those limits and lets you remove the Cloudflare branding from the widget. The plugin is free as well and has no paid version.

Do I need to move my site to Cloudflare?

No. You need a Cloudflare account to create the widget and get your keys, but your domain can stay with any host and any DNS provider.

Does it work with the WooCommerce block checkout?

Yes. The plugin supports both the Checkout block and the classic shortcode checkout, as well as the pay for order page.

Can I use one widget on more than one site?

Yes, as long as every domain is in the widget’s hostname list, up to 10 on the free plan. Cloudflare recommends separate widgets for development, staging and live sites.

Will Turnstile slow my site down?

The plugin has two settings that limit the effect on page speed. It defers its own scripts by default, and it adds a preconnect hint so the browser connects to Cloudflare early. Both options are under Advanced Settings, and the performance and script loading guide explains them.

Summary

To add Turnstile to WordPress, create a widget in the Cloudflare dashboard, install Simple CAPTCHA with Cloudflare Turnstile, paste in your two keys, pass the API test and tick the forms you want to protect. Every setting is covered in the documentation. If you get stuck, you can ask in the WordPress.org support forum.

Grow your WooCommerce store

Our plugins are trusted on 248,000+ WordPress sites.

7-day free trial on any pluginBF2026 30% off your first payment

Coupon Affiliates

Turn coupon codes and referral links into an affiliate program.

4.9/5 rating on WordPress.org

Points & Rewards

Reward customers with points they can spend on future orders.

5/5 rating on WordPress.org

Also: Store Credit · Wishlists · Customer Reports

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *