When implementing the new Google Invisible reCATPTCHA, by default you get a little "protected by reCAPTCHA" badge in the bottom right of the screen that pops out when you roll over it.
I'd like to hide this.
Yes! according to Google's FAQ about the reCAPTCHA you are allowed to hide the badge. However, you have to add a note in the “user flow”. You are allowed to hide the badge as long as you include the reCAPTCHA branding visibly in the user flow.
The CSS Way use display: none or visibility: hidden to hide the reCaptcha batch.
Google now allows to hide the Badge, from the FAQ :
I'd like to hide the reCAPTCHA badge. What is allowed?
You are allowed to hide the badge as long as you include the reCAPTCHA branding visibly in the user flow. Please include the following text:
This site is protected by reCAPTCHA and the Google <a href="https://policies.google.com/privacy">Privacy Policy</a> and <a href="https://policies.google.com/terms">Terms of Service</a> apply.
For example:
So you can simply hide it using the following CSS :
.grecaptcha-badge {
visibility: hidden;
}
Do not use display: none;
as it appears to disable the spam checking (thanks @Zade)
I have tested all approaches and:
WARNING:
display: none
DISABLES the spam checking!
visibility: hidden
and opacity: 0
do NOT disable the spam checking.
Code to use:
.grecaptcha-badge {
visibility: hidden;
}
When you hide the badge icon, Google wants you to reference their service on your form by adding this:
<small>This site is protected by reCAPTCHA and the Google
<a href="https://policies.google.com/privacy">Privacy Policy</a> and
<a href="https://policies.google.com/terms">Terms of Service</a> apply.
</small>
Set the data-badge
attribute to inline
<button type="submit" data-sitekey="your_site_key" data-callback="onSubmit" data-badge="inline" />
And add the following CSS
.grecaptcha-badge {
display: none;
}
For Google reCaptcha v3, the FAQ says:
You are allowed to hide the badge as long as you include the reCAPTCHA branding visibly in the user flow. Please include the following text:
This site is protected by reCAPTCHA and the Google <a href="https://policies.google.com/privacy">Privacy Policy</a> and <a href="https://policies.google.com/terms">Terms of Service</a> apply.
For example:
Note: if you choose to hide the badge, please use
.grecaptcha-badge { visibility: hidden; }
It isn't clear whether it applies to reCaptcha v2. I suggest upgrading to v3 as it's a better experience for your visitors.
Since hiding the badge is not really legit as per the TOU, and existing placement options were breaking my UI and/or UX, I've come up with the following customization that mimics fixed positioning, but is instead rendered inline:
You just need to apply some CSS on your badge container:
.badge-container {
display: flex;
justify-content: flex-end;
overflow: hidden;
width: 70px;
height: 60px;
margin: 0 auto;
box-shadow: 0 0 4px #ddd;
transition: linear 100ms width;
}
.badge-container:hover {
width: 256px;
}
I think that's as far as you can legally push it.
I decided to hide the badge on all pages except my contact page (using Wordpress):
/* Hides the reCAPTCHA on every page */
.grecaptcha-badge {
visibility: hidden !important;
}
/* Shows the reCAPTCHA on the Contact page */
/* Obviously change the page number to your own */
.page-id-17 .grecaptcha-badge {
visibility: visible !important;
}
I'm not a web developer so please correct me if there's something wrong.
EDIT: Updated to use visibility instead of display.
Yes, you can do it. you can either use css or javascript to hide the reCaptcha v3 badge.
display: none
or visibility: hidden
to hide the reCaptcha batch. It's easy and quick..grecaptcha-badge {
display:none !important;
}
var el = document.querySelector('.grecaptcha-badge');
el.style.display = 'none';
Hiding the badge is valid, according to the google policy and answered in faq here. It is recommended to show up the privacy policy and terms of use from google as shown below.
A slight variant of Matthew Dowell's post which avoids the short flash, but displays whenever the contact form 7 form is visible:
div.grecaptcha-badge{
width:0 !important;
}
div.grecaptcha-badge.show{
width:256px !important;
}
I then added the following to the header.php in my child theme:
<script>
jQuery( window ).load(function () {
if( jQuery( '.wpcf7' ).length ){
jQuery( '.grecaptcha-badge' ).addClass( 'show' );
}
});
</script>
Note: if you choose to hide the badge, please use
.grecaptcha-badge { visibility: hidden; }
You are allowed to hide the badge as long as you include the reCAPTCHA branding visibly in the user flow. Please include the following text:
This site is protected by reCAPTCHA and the Google<a href="https://policies.google.com/privacy">Privacy Policy</a> and
<a href="https://policies.google.com/terms">Terms of Service</a> apply.
more details here reCaptacha
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With