Insert code inside functions.php to load Contact Form 7 reCaptcha on contact page only or specific page.
/** * Remove CF7 reCaptcha all page. */ function contact_only_recaptcha() { remove_action( 'wp_enqueue_scripts', 'wpcf7_recaptcha_enqueue_scripts' ); } add_action( 'init', 'contact_only_recaptcha' ); /** * Enqueue scripts CF7 reCaptcha on contact page or specific page. */ function contact_only_recaptcha_checks() { if ( is_page( array( 'contact-us', 'contact' ) ) ) { // Change slug where CF7 is loaded. wpcf7_recaptcha_enqueue_scripts(); } } add_action( 'wp_enqueue_scripts', 'contact_only_recaptcha_checks' );
We’ve tried our best to explain everything thoroughly, even though there’s so much information out there. If you found our writing helpful, we’d really appreciate it if you could buy us a coffee as a token of support.
Also, if you’re interested in learning more about WordPress, Javascript, HTML, CSS, and programming in general, you can subscribe to our MailChimp for some extra insights.