How to hide the Google Invisible reCAPTCHA badge

前端 未结 15 2172
感情败类
感情败类 2020-12-02 04:15

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

相关标签:
15条回答
  • 2020-12-02 05:08

    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;
    }
    
    0 讨论(0)
  • 2020-12-02 05:12

    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>
    

    0 讨论(0)
  • 2020-12-02 05:13

    I saw next comment about this

    It's also helpful to place the badge inline if you want to apply your own CSS to it. But do remember that you agreed to show Google's Terms and conditions when you registered for an API key - so don't hide it, please. And while it is possible to make the badge disappear completely with CSS, we wouldn't recommend it.

    0 讨论(0)
提交回复
热议问题