Implementing Turnstile on Wordpress with or without plugin

Dear Community, I hope to get your support with Turnstile implementation on my Wordpress website

The current implementation was made using Simple Cloudflare Turnstile plugin
The main issue is a suboptimal loading behaviour:
Example of the page link
link to webpagetest.org

Somehow, the turnstile challenge gets preloaded despite Defer Scripts being ON in the Plugin Advanced settings: The resource https://challenges.cloudflare.com/cdn-cgi/challenge-platform/h/g/cmg/1/JJEAHAGp6NaSyqJ%2FkvMgH8F3sCDqJp2Ehe8fKXeGBjI%3D was preloaded using link preload but not used within a few seconds from the window’s load event. Please make sure it has an appropriate as value and it is preloaded intentionally.

There are multiple api.js lines, whereby the 1st is shooting 302 and the 2nd – 200

The number of (?) server-side validation attempts (correct me if I’m wrong) is high and some of them are taking ages.
More errors in DevConsole - link

All my attempts to address this with the plugin developer were unsuccessful, unfortunately, and that triggered my thinking about implementing Turnstile without a plugin

The documentation is detailed about client-side rendering (preloading the js file and placing the line into Contact Forms 7 form template), but it wasn’t clear enough to me on the server-side validation.

As I’m using Cloudways as hosting and Cloudflare as CDN, the worker way seems to be the best (if not the only possible).
However, the example of the worker seems to be incomplete? Please advise
What type of worker should I use for this?

I have also found this tutorial, which has a set of snippets that enable Turnstile on login, password reset, comment and registration elements, but not in CF7 forms (which is essential to me)

Any advice is much appreciated as I’ve been trying to fix this for over 5 months now

Any ideas/suggestions on the topic?

That’s not Turnstile being preloaded. That’s a resource being preloaded while Turnstile is running. You cannot fix this apart from fixing the fact that Turnstile is running even if the modal isn’t opened – I’ve told you how to fix this already in your other post.

No errors here. All expected.

Have you tried the Refer to the full demo on GitHub. link below the example?


TLDR; Turnstile is working as expected. You are just wasting resources because you are telling it to run as soon as the page is loaded instead of only when the modal is opened.

How to fix it? No clue, I don’t do Wordpress.

1 Like