I have tried various snippets, like this:
<?php
add_action( 'wp_print_scripts', 'load_captcha_script', 100 );
function load_captcha_script() {
if ( !is_page( '#register' ) ) {
wp_deregister_script('google-recaptcha');
}
}
but it doesn't work in #register section with hash, I also tried with if (window.location.hash == "#register")
But nothing, recaptcha doesn't load when floating form appears, Is there a snippet that only loads the script when the section appears?