How can I block the youtube api script in my wordpress theme?

Viewed 37

I'm trying to set up a wordpress template and make it GDPR consistent. The problem is that some youtube script gets loaded that sets marketing cookies.

I'm not using any youtube videos on my website, but the script loads in the background anyway. I tried to block it by the Complianz cookie consent plugin, but the youtube cookies were still loaded.

How can I prevent that script from loading and setting these cookies?

What I tried:

  • Delete youtube script in functions.php and similar scripts refering to functions.php
  • Other cookie consent tools (Real cookie banner and Cookiebot)
  • Contacting the theme support

This is the script:

www-widgetapi.js and iframe_api

1 Answers

You could try Borlabscookie. This cookie consent tool is not free but works fine for me. It basically blocks everything from Google until you give your consent. You can even stop embedded Youtube videos from playing!

You can check it out here: https://borlabs.io/borlabs-cookie/

Hope this helps you!

Related