Google Recaptcha is not working on my https site

Posted October 27, 2017 5.2k views

I’m using Google Recaptcha on my website hosted on DigitalOcean. It works properly in my localhost but when I upload to digitalocean host it does not work.

Can someone tell me what’s happening?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
2 answers

Are you setting Content Security Policy headers that prevent the scripts loading?

The dev tools in your browser should have clues as to why the js isn’t loading.

  • I’m not setting any Content security related with JavaScript

    The script is downloading properly, but the recaptcha component does not show

    • CSP headers aren’t set in JS, they’re sent by the webserver.

      If you don’t see any errors in the console in your browser it likely means you pasted the markup incorrectly - check for extra Quotes, >’s and the like in your page source.

      See if you can get it to show on a page by itself, by putting the markup in there instead.