How do I block ads on YouTube?

It is possible, but will cause a world of problems. Support for Adblock formatted lists was dropped several versions ago, as these lists are not compatible with Pi-hole and cause many false positives.

Don't do this.

Pihole blocks on domain level. Youtube serves ads from the same domains as the videos. But ABP can also block content on URL level (like

Pihole won't understand them and skip them. But you may create false positives.

A good approach is to use pihole and a browser plugin at the same time :wink:

Awesome info, and thanks for the responses yubiuser and jfb!

Thanks for the filter. I had to change it to make it work for me. Maybe it's due to the country (Germany) or the structure of the URL has changed in the meantime. Here is my version (one - less in the end):


if you want to create your own filter this webseite might be useful:

2 hours later: With activated filter no YT video is played anymore. Either YT checks whether ads have been played or they then deliver the video via the same URL

1 Like

Thanks for that filter. Works very well! At my setup (Samsung TV, Poland) blocks I think 90% of YT ads.

Any updates on your idea?

This extension for Chrome plus the Pi-Hole with the filter from Snapsz worked perfectly for me.

Simplified enhanced version:

1 Like

@Snapsz Tried your latest version and youtube videos don't load...

@Pendora2017 's version does work (I'm in Belgium, if that would matter)

Have you encountered an issue where the videos keep spinning and do not load at all?
I am seeing this in Android TV and Google Chrome.

It works properly in Hungary.
Could this be good in another country ?

This is not working in US for some reason.

So if I would like to block this regex I should type pihole -b ^r[0-9]+-+sn-+[a-z0-9]+\.googlevideo\.com$ ?

I'm not sure where you're located, but none of the regex patterns provided here are working in the US, at least for me.

Google has caught on to this type of attempt and have out-engineered the rest of us at the moment. They are serving YouTube ads from the same domains as the video content, so blocking one blocks the other. For a company who has made an existence out of advertising, you better believe they have a lot of expert people working to circumvent this type of maneuver to avoid their ad content.

1 Like

This probably also applies to Switzerland. I suspect that the approach chosen is fundamentally wrong.

I confirm. first there is a request from one server, as soon as it is blocked - advertising comes from the same server as the video

1 Like

Both regex didn't work for me (Italy).

I'm now testing this blocklist.

Wont do anything for me .. Im still drowning in ads .

As expected.

This isn't going anywhere and new posts just keep the thread open so I'm closing this.