Disable CF7 integration, except on Contact page
-
The code displayed there doesn’t work anymore: https://contactform7.com/loading-javascript-and-stylesheet-only-when-it-is-necessary/
Despite having these 2 lines in my functions.php file:
add_filter( 'wpcf7_load_js', '__return_false' ); add_filter( 'wpcf7_load_css', '__return_false' );
The following code is still added on every single page of my website:
<script src='***/wp-content/plugins/wpcf7-recaptcha/assets/js/wpcf7-recaptcha-controls.js?ver=1.2' id='wpcf7-recaptcha-controls-js'></script><script id='google-recaptcha-js-extra'> var wpcf7iqfix = {"recaptcha_empty":"Please verify that you are not a robot.","response_err":"wpcf7-recaptcha: Could not verify reCaptcha response."}; </script><script src='https://www.google.com/recaptcha/api.js?hl=en_US&onload=recaptchaCallback&render=explicit&ver=2.0' id='google-recaptcha-js'></script>
Unless I’m wrong, it looks like you added a hotfix for a different issue and this extra code doesn’t check if the variables are set to disable the code or not.
How can I disable the integration sitewide and include the code only on pages I want to?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Disable CF7 integration, except on Contact page’ is closed to new replies.