How do I hide Google reCAPTCHA v3 from my site?

Viewed 6187

I just upgraded from v2 and css is no longer a valid option for hiding the recaptcha badge from my UI. Can this be done with JavaScript?

2 Answers

You can achieve this with recursion and requestAnimationFrame.

Try creating something like this:

function hideRecaptcha() {
    const recaptcha = $(".grecaptcha-badge");
    if (recaptcha.length) return recaptcha.css({ display: "none" });
    requestAnimationFrame(() => this.hideRecaptcha());
}

Then call hideRecaptcha() immediately after loading the recaptcha script.

Related