I would like to use an inline badge with v3, but there is no documentation on badge position for v3.
You can easily use PHP to change the default position. When using Google's v2 Invisible reCAPTCHA, there is a badge that will show in the bottom right corner of the webpage. By default, the position is always set to bottomright. With a small code snippet you can change this position to either bottomleft or inline.
So how to hide the reCaptcha v3 badge? As reported on stack overflow the spam check is not working properly using the code “display:none;”. In addition, you can also use the code “visibility:hidden;” to hide the reCaptcha v3 badge.
reCAPTCHA v3 returns a score (1.0 is very likely a good interaction, 0.0 is very likely a bot). Based on the score, you can take variable action in the context of your site. Every site is different, but below are some examples of how sites use the score.
Yes, you can use both reCAPTCHA (non-Enterprise version) and reCAPTCHA Enterprise. Typically the third party solution asks for your public key and either your secret key or your API key.
You can make the badge inline in V3 with just Javascript it's just not documented yet.
<script src="https://www.google.com/recaptcha/api.js?render=explicit&onload=onRecaptchaLoadCallback"></script>
Then set up your callback like so and don't forget to enter the id/DOM node of where you want your badge to go, in this case, the id is inline-badge
.
<script> function onRecaptchaLoadCallback() { var clientId = grecaptcha.render('inline-badge', { 'sitekey': '6Ldqyn4UAAAAAN37vF4e1vsebmNYIA9UVXZ_RfSp', 'badge': 'inline', 'size': 'invisible' }); grecaptcha.ready(function() { grecaptcha.execute(clientId, { action: 'action_name' }) .then(function(token) { // Verify the token on the server. }); }); } </script>
Example
Source
Note: Valid values for 'badge'
are 'inline'
, 'bottomleft'
, 'bottomright'
, and 'bottom'
. 'bottom'
and 'bottomright'
are synonyms.
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