Cogito ergo sum

How to solve the problem of missing Captcha in GravityForms when cache is on1 min read

Sometimes this problems happens when you have enabled a caching pulgin (W3 total cache or WP fastest Cache etc ) in wordpress which leads to incorrect functionality of javascript and css files responsible for generating the captcha.

Missing captcha

The solution for this problem is simple. What you have to do is to exclude specific css and js files from being cached by the caching plugin. In the case of Gravity forms, these files are :

wp-content/plugins/gravityforms/js/gravityforms.js
wp-content/plugins/gravityforms/css/formreset.css
wp-content/plugins/gravityforms/css/datepicker.css
wp-content/plugins/gravityforms/css/formsmain.css
wp-content/plugins/gravityforms/css/browsers.css

Those files mustn’t be minified by the caching plugin you use.

Another approach is to exclude the pages which uses GravityForms, but that will be, in my opinion, not efficient. Because you don’t have to update the exclusion rules every time you add a new page with a GravityForm.

After applying the mentioned steps, the captcha must be visible.

Present_Captcha

I hope this helped you 🙂

 

About the author

Peshmerge Morad

Data Science student and a software engineer whose interests span multiple fields.

3 comments

Leave a Reply to Earthpulse Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  • Thank you for posting this!

    I experienced the same problem with a Contact Form 7 Captcha and was able to fix it by excluding the following files from being cached:

    /wp-content/plugins/contact-form-7/includes/css/styles.css,
    /wp-content/plugins/contact-form-7/includes/css/styles-rtl.css,
    /wp-content/plugins/contact-form-7/includes/js/scripts.js

    Cheers
    Peter

By Peshmerge Morad
Cogito ergo sum