Turnstile on demand

  • performance
  • forms
  • spam

Updated

Overview

The Simple Cloudflare Turnstile plugin adds a "verify you're human" check to your forms. On its own it downloads Cloudflare's challenge (about 0.6 MB per form) as soon as a page with a form loads, even for a footer form nobody scrolls to. With Dirigible Optimize active, the check waits until it's needed:

  • It loads when a visitor scrolls near the form, clicks or types in it, or first taps or presses a key anywhere on the page.
  • On a page with several forms, only the forms the visitor reaches run the check.
  • A form near the top of the page shows the check straight away, as before.

There's nothing to set up. It works as soon as both plugins are active.

Which forms

Form When the check appears
Gravity Forms When the form comes near the screen, or someone clicks into it.
WordPress login placed on a page, for example a Login/out block in a mega menu When the form is showing and near the screen, or someone clicks into it.
Comment forms on posts When the visitor scrolls down to the comment form or starts writing a comment, including after clicking Reply.
WooCommerce login and lost password on the My Account page When the form is showing and near the screen, or someone clicks into it.

The WordPress login screen itself (wp-login.php), the WooCommerce checkout and any other form the plugin protects keep loading the check straight away. If a page mixes one of those with the forms above, the whole page keeps the plugin's usual behaviour.

On WooCommerce sites the plugin also loads WordPress's React and data scripts (about 110 KB) on every page with a form. Only the checkout uses them, so Optimize skips them on other pages. The checkout, and any page with a Checkout block, loads them as before.

Spam protection is unchanged

Every form is still checked on the server. A form sent before its check has finished is turned away with "Please verify that you are human", just as it would be without Optimize. When you test a form far down a page, scroll to it (or click into a field) and let the check finish before you submit.

Turn it off

Deactivate Dirigible Optimize: the plugin's own loading comes back on the next uncached page view. Purge the cache to see it straight away (see Troubleshooting). For a developer, define('DS_TURNSTILE_LAZY', false); in wp-config.php switches off only this feature.