Paste the code below at the bottom of your functions.php file. In the example below the page domain.com/contact and the page domain.com/some-other-page-with-form will have the badge visible.

add_action('wp_print_scripts', function () {
 //Add pages you want to allow to array
 if ( !is_page( array( 'contact','some-other-page-with-form' ) ) ){
  wp_dequeue_script( 'google-recaptcha' );
  //wp_dequeue_script( 'google-invisible-recaptcha' );
 }
});

The CSS code below can be pasted into main css file.

.grecaptcha-badge {
display: none;
}
Source: https://wplearninglab.com/hide-recaptcha-v3-badge/
 

Leave a Comment

You must be logged in to post a Review.