WP Manifestindependent plugin directory
manifest / security / cloudflare-turnstile-wordpress

Turnstile Validation

by meonvalleyweb · github.com/meonvalleyweb/cloudflare-turnstile-wordpress

0stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/meonvalleyweb/cloudflare-turnstile-wordpress/archive/refs/heads/main.zip

Cloudflare Turnstile Validation for WordPress (Breakdance Compatible)

A lightweight WordPress plugin to validate Cloudflare Turnstile CAPTCHA responses. Ideal for Breakdance forms or any custom HTML form.


📌 Features

  • ✅ Validates cf-turnstile-response on form submission
  • ✅ Blocks form processing if Turnstile fails
  • ✅ Reads Turnstile secret key from .env (Bedrock-compatible)
  • ✅ Plugin-based (no theme edits needed)
  • ✅ Works with any form builder (Breakdance, custom, etc.)

⚙️ Requirements

  • WordPress (Bedrock or standard)
  • PHP 7.4+
  • Cloudflare Turnstile Site & Secret Keys
  • Optional: Breakdance Builder

🚀 Installation

  1. Clone or download into wp-content/plugins/turnstile-validation

  2. Add the secret key to your .env file:

    CLOUDFLARE_TURNSTILE_SECRET=your_secret_key_here
  3. Expose it in config/application.php:

    Config::define('CLOUDFLARE_TURNSTILE_SECRET', env('CLOUDFLARE_TURNSTILE_SECRET'));
  4. Activate the plugin in your WordPress admin.


🧪 Usage

In your form (e.g., Breakdance HTML block), add:

<script src="https://challenges.cloudflare.com/turnstile/v0/api.js" async defer></script>
<div class="cf-turnstile" data-sitekey="your_site_key_here"></div>

Make sure your form:

  • Uses the POST method
  • Includes the hidden field cf-turnstile-response
  • Submits to a page that runs before wp_loaded (usually handled by this plugin)

📸 Screenshot

Example Turnstile widget in a Breakdance form:

Cloudflare Turnstile in Breakdance Form


📝 License

This plugin is open-sourced under the MIT License.