Skip to content
FunnelGuard

Fix guide by FunnelsGuard

Turnstile or hCaptcha not loading: how to find and fix it

DLV-202High impactDetectedBy FunnelGuardPublished Updated
On this page

What this issue is

Cloudflare Turnstile and hCaptcha are bot checks. A small script from challenges.cloudflare.com or hcaptcha.com draws a widget in your form. When the visitor passes, the widget adds a hidden token. Your server then verifies that token before it accepts the form.

Where the form breaks
  1. Visitor opens pageForm is visible
  2. Captcha script loadsBlocked, wrong key or never rendered
  3. Token createdNo token
  4. Form acceptedSubmit fails or is rejected
  5. Lead in inbox/CRMNever arrives

The widget never loads, so no token is created and the submit fails.

Why it costs you leads or sales

A missing widget blocks the visitors who were ready to contact you. They click submit, see an error or nothing, and most leave. You get no email and no error report, so it can run for days. Paid traffic keeps arriving and you keep paying for clicks that cannot convert.

Form submissions per weekExample numbers
Form submissions per week (example)Week before: 40 submissions; Week of change: 6 submissions; Week after fix: 39 submissions0153140639Week beforeWeek of changeWeek after fixsubmissions

Example: a form that normally gets 40 leads a week drops to near zero after a Content Security Policy change blocks the captcha script.

How to check if your site has it

Check the widget in a browser
  1. Open the form in a private window

    Turn off extensions. Look for the widget or its placeholder where the form should show it.

  2. Open DevTools Console

    Press F12 and open Console. Look for messages like 'Refused to load the script' or 'Refused to frame', which point to a Content Security Policy block, or 'Invalid domain' or 'Invalid site key'.

  3. Open the Network tab

    Reload and filter for turnstile, challenges.cloudflare.com or hcaptcha. The script should return status 200. Red or blocked rows are your cause.

  4. Inspect the form HTML

    Look for an element with class cf-turnstile or h-captcha and a data-sitekey attribute. If it's missing, the widget isn't rendered.

  5. Submit the form

    Check that a hidden field named cf-turnstile-response or h-captcha-response has a value before you submit.

Common symptoms and likely causes
What you seeLikely cause
Console: Refused to load scriptContent Security Policy missing the captcha domain
Widget area empty, no errorsScript delayed, deferred or removed by a caching or optimisation plugin
Widget shows an error codeWrong site key, or domain not added to the widget settings
Works on desktop, fails for some usersAd blocker, firewall or privacy tool blocking the script
Widget appears but submit still failsServer-side secret key wrong, or token expired

How to fix it

Start with the cause you found in DevTools. The most common are a Content Security Policy (CSP, a header that lists which domains may load scripts), an optimisation plugin that delays scripts, and a key or domain mismatch.

CSP entries to allow Turnstiletext
script-src https://challenges.cloudflare.com;
frame-src https://challenges.cloudflare.com;
connect-src https://challenges.cloudflare.com;
CSP entries to allow hCaptchatext
script-src https://hcaptcha.com https://*.hcaptcha.com;
frame-src https://hcaptcha.com https://*.hcaptcha.com;
style-src https://hcaptcha.com https://*.hcaptcha.com;
connect-src https://hcaptcha.com https://*.hcaptcha.com;
Minimal Turnstile embedhtml
<script src="https://challenges.cloudflare.com/turnstile/v0/api.js" async defer></script>
<form method="post" action="/contact">
  <!-- your fields -->
  <div class="cf-turnstile" data-sitekey="YOUR_SITE_KEY"></div>
  <button type="submit">Send</button>
</form>
Fix by platform
  1. Exclude the captcha script from optimisation

    In your caching or speed plugin, turn off delay, defer or combine for challenges.cloudflare.com or hcaptcha.com, then clear the cache. Settings names vary by plugin.

  2. Re-enter the keys

    In your form plugin's captcha settings, paste the site key and secret key again from the Cloudflare or hCaptcha dashboard. Make sure there are no spaces.

  3. Check security plugins

    If a security plugin adds a CSP header, add the captcha domains to it.

How to confirm it's fixed

Confirmation checklist
  • The widget shows in a private window with extensions off
  • The Console shows no CSP or invalid key errors
  • The captcha script returns status 200 in the Network tab
  • The hidden response field has a value before submit
  • A test submission shows the success message
  • The test lead arrives in your inbox and CRM
  • It also works on mobile and in a second browser

How to prevent it happening again

Prevention habits
  • Retest the form after every theme, plugin, CSP or caching change
  • Keep the captcha domains in your CSP when you edit security headers
  • Add every new domain or subdomain to the widget's allowed hostnames
  • Store keys in one place and note who owns the captcha account
  • Run a scheduled test of the real form instead of waiting for a customer to complain

How FunnelGuard handles this

FunnelGuard detects this today. A robot visitor runs your real form journey on a schedule from the EU or the US. If the step is blocked by bot protection or the submit fails, the check fails.

A failure is re-checked from a second region before one alert goes out, by email, Slack, Teams, WhatsApp, webhook or PagerDuty. The alert includes a screenshot and a likely cause. FunnelGuard never bypasses CAPTCHAs or bot protection, so a check that is stopped by the challenge is reported as it is. You may need to review your protection rules with that in mind. The Free plan covers 1 site and 2 journeys with daily checks and no card, and paid plans have a 3-day free trial.

Questions people ask

Why is my Cloudflare Turnstile widget not showing?

The most common causes are a Content Security Policy that doesn't allow challenges.cloudflare.com, a caching plugin that delays or removes the script, and a wrong site key or unlisted domain. Open the browser Console and Network tab to see which one applies.

Why is hCaptcha not loading on my form?

Usually the hcaptcha.com script is blocked by a CSP, an optimisation plugin or an ad blocker, or the site key doesn't match the domain. Check the Console for errors and confirm the script returns status 200.

How do I fix a Content Security Policy blocking Turnstile?

Add https://challenges.cloudflare.com to the script-src, frame-src and connect-src directives of your CSP header, then reload and check the Console. For hCaptcha, add hcaptcha.com and *.hcaptcha.com instead.

Why does the captcha work for me but not for my visitors?

Ad blockers, privacy extensions, corporate firewalls and cached pages can block the script for some visitors only. Test in a private window with extensions off, on mobile, and on another network.

Can a captcha that doesn't load stop all my form leads?

Yes. If the widget never produces a token, the form can't be submitted or the server rejects it. Visitors see an error or nothing, and you receive no notification.

How do I know if my captcha site key is wrong?

The widget usually shows an error code or the Console reports an invalid site key or domain. Compare the key in your page with the one in the Turnstile or hCaptcha dashboard and check that your hostname is allowed.

Can FunnelGuard tell me when my captcha stops working?

Yes, it detects when the form step is blocked by bot protection or the submit fails during a scheduled test of your real journey. It re-checks from a second region and sends one alert with a screenshot and a likely cause.

Does FunnelGuard catch this?

Detected

FunnelGuard checks for this today.

How: blocked_by_bot_protection or submit fails.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.