← Back to Guides
Cloudflare Turnstile Setup
Free bot protection for your booking, contact, review, and registration forms.
What is Turnstile?
Cloudflare Turnstile is a free CAPTCHA alternative that protects your forms from bots and spam without annoying real users. Most visitors will never see a challenge. It runs invisibly in the background and verifies that visitors are human.
Step 1: Create a Turnstile Widget
- Log in to your Cloudflare Dashboard at dash.cloudflare.com
- Go to Turnstile in the left sidebar
- Click "Add Site"
- Enter your site name and domain:
bestphuketguide.com - Select Managed widget mode (recommended, invisible for most users)
- Click "Create"
Step 2: Copy Your Keys
After creating the widget, you will see two keys:
- Site Key (public): safe to use in frontend code
- Secret Key (private): NEVER expose to frontend
Warning: Keep the Secret Key secure. It is used server-side only to verify tokens.
Step 3: Configure in Admin Panel
- Go to Settings in your admin panel
- Click the "Security" tab
- Toggle "Enable Turnstile" ON
- Paste your Site Key and Secret Key
- Click "Save Security Settings"
What Forms Are Protected?
| Form | Page |
|---|---|
| Booking | /booking/:slug |
| Contact | /contact |
| Review | /review/:ref |
| Registration | /account/register |
Testing Locally
Cloudflare provides test keys for local development:
Tip: Use these in your admin Security settings for local testing:
Always passes:
Site Key: 1x00000000000000000000AASecret Key: 1x0000000000000000000000000000000AAAlways shows challenge:
Site Key: 3x00000000000000000000FFSecret Key: 3x0000000000000000000000000000000FFTroubleshooting
- Widget not showing? Check that Turnstile is enabled in admin settings and the Site Key is correct.
- "Bot verification required" error? The widget did not generate a token. Try refreshing the page.
- "Bot verification failed" error? The Secret Key may be wrong or the token expired (tokens last 300 seconds).
- Works locally but not in production? Make sure the domain in Cloudflare Turnstile matches your production domain. Test keys only work on localhost.
Cost
Cloudflare Turnstile is completely free with unlimited verifications. No usage limits.
Related Guides