Turnstile CAPTCHA For WooCommerceTurnstile CAPTCHA For WooCommerce
Buy Now
View Demo
  • Getting Started

    • Introduction
    • Quick Start
    • Features
    • Installation
    • First-Time Setup
    • Get Turnstile Keys
    • Onboarding Wizard
  • Settings

    • Settings Overview
    • API Settings
    • General
    • Design Studio
    • Conditional Rules
    • Per-Form Config
    • Notifications
  • Supported Forms

    • All Supported Forms
    • WooCommerce Forms
    • WordPress Forms
    • Third-Party Form Plugins
    • Checkout Blocks
    • Shortcode
  • Protection & Monitoring

    • Analytics Dashboard
    • Rate Limiting
    • Recovery URL
    • Email Digest
    • Webhooks
  • Developer

    • REST API
    • Filters & Hooks
    • Site Health
  • Compare

    • vs reCAPTCHA
    • vs hCaptcha
  • Help

    • Troubleshooting
    • FAQ
    • Glossary
Support
Buy Now
View Demo
  • Getting Started

    • Introduction
    • Quick Start
    • Features
    • Installation
    • First-Time Setup
    • Get Turnstile Keys
    • Onboarding Wizard
  • Settings

    • Settings Overview
    • API Settings
    • General
    • Design Studio
    • Conditional Rules
    • Per-Form Config
    • Notifications
  • Supported Forms

    • All Supported Forms
    • WooCommerce Forms
    • WordPress Forms
    • Third-Party Form Plugins
    • Checkout Blocks
    • Shortcode
  • Protection & Monitoring

    • Analytics Dashboard
    • Rate Limiting
    • Recovery URL
    • Email Digest
    • Webhooks
  • Developer

    • REST API
    • Filters & Hooks
    • Site Health
  • Compare

    • vs reCAPTCHA
    • vs hCaptcha
  • Help

    • Troubleshooting
    • FAQ
    • Glossary
Support
  • Getting Started

    • Introduction
    • Quick Start — Turnstile Live in 5 Minutes
    • Features — Everything the Plugin Can Do
    • Installation — Full Setup Guide
    • First-Time Setup
    • Get Turnstile Keys from Cloudflare
    • Onboarding Wizard
  • Settings

    • Settings Overview — All 9 Tabs
    • API Settings Tab
    • General Settings Tab
    • Design Studio Tab
    • Conditional Rules Tab
    • Per-Form Config Tab
    • Notifications Tab
  • Supported Forms

    • All Supported Forms
    • WooCommerce Forms
    • WordPress Forms
    • Third-Party Form Plugins
    • Checkout Blocks Integration
    • Shortcode — Drop the Widget Anywhere
  • Protection & Monitoring

    • Analytics Dashboard
    • Rate Limiting — Auto-Lockout for Abusive IPs
    • Recovery URL — Unlock a Stuck IP
    • Email Digest
    • Webhooks — Real-Time Alerts on Bot Spikes
  • Developer

    • REST API
    • Filters & Hooks
    • Site Health Integration
  • Compare

    • Turnstile vs Google reCAPTCHA
    • Turnstile vs hCaptcha
  • Help

    • Troubleshooting
    • Frequently Asked Questions
    • Glossary

API Settings Tab

API Settings tab — paste Cloudflare keys and test the connection live

The first tab you land on. Without valid keys here, nothing else works.

URL: wp-admin/admin.php?page=wkcft-settings&tab=wkcft_api

Fields

Site Key

  • Option key: wkcft_site_key
  • Type: Text
  • Source: Cloudflare dashboard → Turnstile → your widget → Site Key
  • Format: Starts with 0x4AAA..., ~25 characters
  • Safe to share? Yes — this key is visible in the page source on every visitor's browser

Paste from Cloudflare, click Save Changes.

Secret Key

  • Option key: wkcft_secret_key
  • Type: Password (with show/hide eye icon)
  • Source: Cloudflare dashboard → Turnstile → your widget → Secret Key
  • Format: Starts with 0x4AAA..., ~35 characters
  • Safe to share? No — this key sits on your server only and must not leak into frontend code

Never commit the Secret Key to git

If your theme or custom plugin ever needs the Secret Key, read it from get_option('wkcft_secret_key') at runtime. Never hard-code it and never commit it to version control.

Action Buttons

Test Connection

Click to run a live end-to-end check:

  1. Plugin renders a test Turnstile widget using your Site Key
  2. Solves the widget in-browser to get a token
  3. Sends that token + Secret Key to challenges.cloudflare.com/turnstile/v0/siteverify
  4. Shows a green "API keys are valid" OR a red error with explanation

Any test failure will match one of the Cloudflare error codes listed below.

Save & Test

Same as Save Changes + Test Connection in one click. Use this after pasting fresh keys.

Get Keys

Opens the Cloudflare Turnstile dashboard in a new tab. See Get Turnstile Keys for the step-by-step guide.

Copy Shortcode

Copies [wkcft-turnstile] to your clipboard so you can paste it on any page, post, or custom widget.

Live Widget Preview

Below the key fields, you see a live Cloudflare Turnstile widget rendered with your saved Site Key.

  • If the widget appears and you can interact with it — Site Key is valid
  • If you see "Invalid sitekey" — your key is wrong OR the hostname is not in your Cloudflare widget config
  • If you see nothing — the script did not load (check browser console, check caching plugin)

Cloudflare Error Codes (Reference)

When Test Connection fails, you see one of these codes:

CodeMeaningFix
missing-input-secretSecret Key field is emptyPaste Secret Key, save
invalid-input-secretSecret Key is wrongRe-copy from Cloudflare
missing-input-responseNo token was sentWidget did not render — check Site Key
invalid-input-responseToken is malformed or expiredClear caching plugin, test again
bad-requestMalformed verify requestRarely seen — file a support ticket
timeout-or-duplicateToken reused or timed outTokens expire in 5 min. Cached pages cause this — flush cache

Full error code table: Troubleshooting.

Caching Plugin Warning

If you have WP Rocket, LiteSpeed Cache, W3 Total Cache, or Autoptimize active, the tab shows a yellow notice:

Caching plugin detected. After you change Turnstile settings, flush that plugin's cache so visitors get the new widget config.

One-click flush shortcuts appear under the notice when the plugin is detected.

Which Widget Modes Work

Any of Cloudflare's three widget modes works with the plugin:

Cloudflare ModeWhat Users SeeUse This If
ManagedMostly invisible. Interactive challenge only for suspicious visitorsDefault — recommended
Non-interactiveAlways invisibleYou want 100% friction-free UX
InvisibleAlways runs a challenge in the backgroundYou want max protection without a visible widget

You configure this inside Cloudflare, not inside the plugin.

Rotating Your Secret Key

If your Secret Key leaks:

  1. Cloudflare dashboard → Turnstile → your widget → Rotate secret key
  2. Copy the new Secret Key
  3. Paste into this tab → Secret Key field → Save Changes
  4. Click Test Connection to verify the new key works

There is no downtime — tokens issued under the old key finish processing, new ones use the new key.

Frequently Asked

Q: Do I need the Enterprise plan for Turnstile? No. Turnstile is free forever on every plan, including the Free plan.

Q: Can I use the same keys on multiple sites? Yes — add all hostnames to the same Cloudflare widget. Or create one widget per site for cleaner analytics on Cloudflare's side.

Q: What if I need to change hosts (e.g., migrate to a new domain)? Add the new domain to your Cloudflare widget's Hostname Management. Old domain keeps working until you remove it.

Q: Is the Site Key safe to put in a public repo? Yes. It is meant to be public. Only the Secret Key is sensitive.

Related Pages

  • Get Turnstile Keys — How to create keys from scratch
  • General Settings — Tab 2: theme, load mode, etc.
  • Troubleshooting — Fixes for key-related errors
Prev
Settings Overview — All 9 Tabs
Next
General Settings Tab