The problem is that Contact 7’s code is embedded on all individual pages and not just on pages with forms.
<script type='text/javascript'>
/* <![CDATA[ */
var wpcf7 = {"apiSettings":{"root":"https:\/\/www.domain.com\/de\/wp-json\/contact-form-7\/v1","namespace":"contact-form-7\/v1"},"cached":"1"};
/* ]]> */
</script>
<script type='text/javascript' src='https://www.domain.com/wp-content/plugins/contact-form-7/includes/js/scripts.js?ver=5.1'></script>
<script type='text/javascript' src='https://www.google.com/recaptcha/api.js?render=xxx;ver=3.0'></script>
<script type="text/javascript">
( function( grecaptcha, sitekey ) {
var wpcf7recaptcha = {
execute: function() {
grecaptcha.execute(
sitekey,
{ action: 'homepage' }
).then( function( token ) {
var forms = document.getElementsByTagName( 'form' );
for ( var i = 0; i < forms.length; i++ ) {
var fields = forms[ i ].getElementsByTagName( 'input' );
for ( var j = 0; j < fields.length; j++ ) {
var field = fields[ j ];
if ( 'g-recaptcha-response' === field.getAttribute( 'name' ) ) {
field.setAttribute( 'value', token );
break;
}
}
}
} );
}
};
grecaptcha.ready( wpcf7recaptcha.execute );
document.addEventListener( 'wpcf7submit', wpcf7recaptcha.execute, false );
} )( grecaptcha, 'xxx );
</script>
Of course, the badge should be displayed on pages with a form and this also corresponds to the terms and conditions of Google.
-
This reply was modified 5 years, 10 months ago by
dblue71.
-
This reply was modified 5 years, 10 months ago by
dblue71.
-
This reply was modified 5 years, 10 months ago by
dblue71.