Your support helps keep this blog running! Secure payments via Paypal and Stripe.
When you add the contact form or any forms to your website and web application, it is a good idea to add Google reCAPTCHA to protect your website and web application from fraud and abuse.
However, if your website uses the cache plugin, you may see the “Google reCAPTCHA verification failed, please try again later” error while you are trying to submit the form. Why?
Check where the Error Comes from
You can follow the steps below to identify the issue.
- Log in to WordPress (In my case, I configured the cache plugin won’t cache when the administrator user logs in. This way, if the cache configuration causes any issue, I can check it with my administrator user.)
- Visit the page where you added the form that generates the error
- Test by submitting the form
- If you don’t see any error while you are submitting for form, then follow the next step
- Log out of WordPress
- Visit the page where you add the form that generates the error
- Open the inspector from the browser(F12) and open the Console tab
- Test by submitting the form
- If you see the error “Google reCAPTCHA verification failed, please try again later” and also see “Uncaught ReferenceError: grecaptcha is not defined” JS error at the Console tab, that means the cache plugin is the cause of the reCAPTCHA error.
Fix Google reCAPTCHA Verification Failed
As we check from the steps above, it shows that when you log in to WordPress and test the form, there is no issue. But when you log out of WordPress and test the form, there is an issue. Plus, your site uses the cache plugin.
In my case, I configure the cache plugin by using the minify option for CSS and JS. For reducing the loading page and displaying the site content to the visitors faster, I configured the defer option to the JS file as well. And this configuration causes the error.
To fix it, you simply exclude the recaptcha file from the defer option.
In my case, I use the LiteSpeed Cache plugin. At the plugin, I will go to page optimization, then look for the JS Deferred Excludes option. Then add recaptcha/api.js for this option. Save the change and clear the cache. Now, log out of WordPress and test the form again. You should not see any error anymore.
Other Issues May Be:
- Google reCAPTCHA verification code needs to be changed. You need to go back to your Recaptcha admin panel and generate a new verification code, and copy that new code to your site.
- Your current theme conflicts with the Recaptcha JS file. You can test it by changing to the default WordPress theme and checking the form again. If no error occurs, it means your current theme causes the error.
- Your form won’t work with the current reCAPTCHA version. There are two versions that you can try, which are reCAPTCHA v2 and v3.
Your support helps keep this blog running! Secure payments via Paypal and Stripe.

