@xootix It helped, but caused some errors in console. I edited it a bit so it wont show any errors – here is the code:
//dequeue google recaptcha
add_action( 'wp_enqueue_scripts', function(){
wp_dequeue_script('xoo-el-google-recaptcha');
}, 100 );
//enqueue recaptcha
add_action( 'wp_enqueue_scripts', function(){
wp_enqueue_script('xoo-el-google-recaptcha','https://www.google.com/recaptcha/api.js?render=explicit"async defer',array(),XOO_EL_VERSION,true);
}, 9999 );
add_action( 'wp_footer', function(){
if ( !is_user_logged_in() ){
?>
<script type="text/javascript">
jQuery(document).ready(function(){
setTimeout(function(){
if ( jQuery('.xoo-el-recaptcha').length <= 0){
window.XooElCaptchaCallback();
}
},500)
})
</script>
<?php
}
} );