Google Recaptcha is not working on my https site

October 27, 2017 2.8k views
Ubuntu DigitalOcean Applications

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?

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.

Have another answer? Share your knowledge.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!