How to bypass YouTube's anti ad blocker prompt

Martin Brinkmann
May 12, 2023
Updated • May 16, 2023
Updated the bypass code to bypass YouTube's anti-ad-blocking prompt.
Youtube
|
34

For the past couple of days, some YouTube users were blocked from watching videos on the site. These users were informed that "ad blockers are not allowed on YouTube" and that they could not start watching the selected video unless they would either disable the ad blocker or subscribe to YouTube Premium.

ad blockers are not allowed on YouTube

Google admits in the notification that it may ere, and that it has detected an ad blocker erroneously.  Falsely flagged users can use the report issue link displayed, but they too can't continue when they see the notification.

The prompt appears to be a test and it is unclear how widespread it is. Not all users are seeing the prompt if they use content blockers.

Why is Google displaying the anti ad blocker prompt on YouTube?

For Google, the answer is lost revenue. YouTube revenue comes to a very large degree from advertisement. While Google has established YouTube Premium as an option, most users of the site do not subscribe to the service.

Blocking users, who use content blockers, from accessing YouTube has a few advantages for YouTube and only one danger. On the advantage side, Google may increase revenue as some users may disable their ad blocker on YouTube or subscribe to YouTube Premium, if they find the ads overwhelming. Users who do not do so won't use any resources of the site, unless they figure out a way to bypass the anti ad blocker message (see below for how to do that).

The main danger is that YouTube might become less relevant, if lots of users move to other services. There is no imminent danger here, as YouTube has such a dominating lead.

Why do users use content blockers?

Most Internet users understand that websites and services such as YouTube need to finance operations somehow. Advertisement is common.

Issues arise when ads become obnoxious. On YouTube, many users might consider advertising problematic, especially since ads may be displayed multiple times throughout videos. In 2022, Google ran tests that showed up to 10 ads before videos.

Most users might not have problems with ads being shown before or after videos though.

How to block the anti ad block message on YouTube

youtube block anti ad-blocker notification

It takes just a few lines of instructions to block the prompt on YouTube.

Here is the code that you need (updated)

youtube.com,youtubekids.com,youtube-nocookie.com#@#+js(json-prune, [].playerResponse.adPlacements [].playerResponse.playerAds playerResponse.adPlacements playerResponse.playerAds adPlacements playerAds)

youtube.com,youtubekids.com,youtube-nocookie.com##+js(json-prune, [].playerResponse.adPlacements [].playerResponse.playerAds)

youtube.com,youtubekids.com,youtube-nocookie.com##+js(json-prune, playerResponse.adPlacements playerResponse.playerAds adPlacements playerAds, playerConfig)

youtube.com,youtubekids.com,youtube-nocookie.com##+js(json-prune, auxiliaryUi.messageRenderers.enforcementMessageViewModel)

youtube.com,youtubekids.com,youtube-nocookie.com##+js(set, ytInitialPlayerResponse.auxiliaryUi.messageRenderers.enforcementMessageViewModel, undefined)

This is the old code, which may not be working correctly:

youtube.com##+js(set, yt.config_.openPopupConfig.supportedPopups.adBlockMessageViewModel, false)

youtube.com##+js(set, Object.prototype.adBlocksFound, 0)

youtube.com##+js(set, ytplayer.config.args.raw_player_response.adPlacements, [])

youtube.com##+js(set, Object.prototype.hasAllowedInstreamAd, true)

All that is left to do is add it to the list of custom instructions in the content blocker that you are using.

Here are two examples:

In Brave Browser, load brave://adblock to open the main Shields preferences page. Scroll down on the page until you find the "create custom filters" section.

Paste the four lines of instructions into the text area there and hit the save changes button afterwards.

Users of the popular content blocker uBlock Origin need to open the uBlock Dashboard with a click on the uBlock Origin icon and the selection of the Dashboard icon in the interface that opens.

There, they need to switch to the My filters tab, paste the four lines into the text field and select apply changes to add the instructions to uBlock Origin.

YouTube should not display the prompt anymore after the changes have been made. Open YouTube tabs need to be reloaded though.

Please note that Google may modify its code and this may require different instructions to block the new prompt from displaying. For now, this code bypasses the anti ad blocker warning on YouTube.

Bonus Tip: third-party YouTube clients such as FreeTube or YouTube apps for Android do not show ads as well.

Now You: do you use YouTube?

Summary
How to bypass YouTube's anti ad blocker prompt
Article Name
How to bypass YouTube's anti ad blocker prompt
Description
Find out how to block the anti ad blocker prompt that YouTube is displaying to some users of the site who are using a content blocker.
Author
Publisher
Ghacks Technology News
Logo
Advertisement

Tutorials & Tips


Previous Post: «
Next Post: «

Comments

  1. kajvg said on January 3, 2024 at 4:23 am
    Reply

    would someone list the alternatives to youtube, which has now become worse by the day in fact microsoft has now effectively destroyed the once great site. Youtube is now garbage.

    To hell with microsoft, they ruined the Skype too, remember?

  2. Mikahel said on November 7, 2023 at 9:26 pm
    Reply

    Currently AdBlocker ultimate on Edge is working without any script

  3. Dickman said on October 24, 2023 at 8:35 am
    Reply

    YT is very agressive this time!
    Your new code with 5 lines is not working any more. :(

  4. Panos said on October 19, 2023 at 10:12 am
    Reply

    Hello from Greece! I have been using UBlock – Origin for years, without probs, until last week where Youtube started these annoying warnings. I used the updated code on Ublock filters and nothing happened. Then I tried the old one and it worked! Thank you!

  5. j59 said on October 19, 2023 at 1:17 am
    Reply

    As of Oct 18 2023 the ‘updated code’ does not work

  6. Fred Armisen said on August 13, 2023 at 1:41 pm
    Reply

    yeah those don’t work anymore. If an updated code exists I would appreciate it being added

  7. Sean said on August 11, 2023 at 11:07 pm
    Reply

    Maybe if Google wasn’t such a piece of trash corporation, this wouldn’t have been an issue in the first place. They somehow managed to ruin what was a perfectly good thing as soon as they bought it, and have only continued to fail the users and content creators with their greed and short-sightedness.

    1. Anonymous said on October 21, 2023 at 7:11 am
      Reply

      This is the reality. Google is a a garbage company. Their greed has ruined YouTube. I am just glad that there are alternative ways to access YouTube, as well as for the existence of other similar video-streaming platforms. Good to know about these just in case the BS on YouTube becomes too invasive.

  8. Xiaobo Liu said on May 13, 2023 at 2:10 pm
    Reply

    The people of the Internet are always ahead in the arms race

    Until big tech fires the weapon of law — copyright trolling. It is US that created the content on YouTube, not Google themselves, and it is not their copyright! But big tech does have $$ to have a lot of lawyers to hire, and YouTube can take down the ad filter lists like how it had taken down youtube-dl.

    1. Dellorto said on May 13, 2023 at 11:01 pm
      Reply

      “taken down youtube-dl” Hah! How did that go then? Plenty of programs using youtube-dl still work flawlessly.

      1. Kirk said on May 15, 2023 at 4:19 am
        Reply

        youtube-dl ‘s GitHub was restored eventually, IIRC though development on that app has been slow. yt-dlp is a fork of youtube-dl with a slew of more features and is more constantly updated.

    2. John G. said on May 13, 2023 at 5:33 pm
      Reply

      @Xiaobo Liu, +1 so sad but so true.

  9. FanboyNZ said on May 13, 2023 at 5:52 am
    Reply

    These filters may not work (2 users confirmed it hasn’t worked), we’re still debugging the issue.

    youtube.com#@##YtKevlarVisibilityIdentifier
    youtube.com#@##YtSparklesVisibilityIdentifier
    youtube.com##+js(set, __google_lidar_, 0)

    Filters included in Fanboy Annoyances in uBO / Brave (force an update)

  10. Anonymous said on May 12, 2023 at 11:29 pm
    Reply

    In uBO, I have some personal filters, but they all start with 2 vertical lines, like this ||
    Do we need to add them?

    Also, in Brave browser personal filter, if I want to add my own comments, what exclusion marks do I need so the browser don’t try to interpret them?
    Can I use exclamation mark ! just like in uBO, or can I use /* my comment */ ?

    https://www.ghacks.net/2023/05/12/how-to-bypass-youtubes-anti-ad-blocker-prompt/
    BTW, does anyone know how to bypass the “Before you continue to YouTube” nag screen popping up when visiting YT for the first time?

  11. Allith said on May 12, 2023 at 10:35 pm
    Reply

    Thank you for the tip, dont need it yet. I use origin on firefox Android and revanced client. I have to check my Firefox desktop

  12. Let's Riot said on May 12, 2023 at 9:16 pm
    Reply

    Now funding content creators with ads, who publish useful videos, is one thing. Making girls showing their asses and calling the videos yoga or some dude talking about football shoes millionaires by showing us ads is a completely different thing. 99% of the content on youtube is complete garbage made by greedy idiots. Youtube needs to split into different platforms, the joke it is now where clowns rule and the serious, informative and useful videos. Also another one where musicians, that upload their own music, get paid fairly. Finally. Right now we have greedy leeches all over the place, Google being the greediest of them all. Let’s not forget most of the music uploaded to youtube is not there legally by a longshot..

    1. basingstoke said on May 16, 2023 at 5:49 pm
      Reply

      You had me up until music: what are you on about?

      Lots of labels now use the “Artist – Topic” method to automatically upload music that is released on streaming platforms. These videos are prioritised over user-uploaded videos in the search results, even though in my opinion they’re inferior (they all have comments disabled).

      Next you have the user uploaded videos: Videos containing anything that is in the music “database” (it’s a massive database) will be detected. If someone just uploads a full song, it will be “copyright claimed”, and the uploader can get views, likes, but adverts will be placed on the videos regardless of user choice, and the “ad-revenue” in this instance goes 100% to the record label. This will even happen in many cases if you use a copyrighted song for a short sample.

      If a user uploads multiple copyrighted pieces of audio within one video, EACH is detected, and it’s the same as before – adverts are placed on the video without the user consent, and revenue is split between record labels owning the copyrighted detected media.

      This system is actually really terrible from a user-freedom perspective – someone uses 20 seconds of a song in their video and the entire video will be claimed, and all revenue lost. But the point is the system HEAVILY benefits artsist/musicians/record-labels at the expense of regular joes uploading videos.

      What I don’t like is the people that PUSH for this system (such as yourself!). You can get lost, once something is uploaded to the internet you’ve already lost control over it, go cry about it, and whilst crying try to think of a real way to make money (aka, sell physical items – or partner with paid music streaming platforms (youtube is NOT yet one of these). Or actually get up off your butt and upload your own music to these platforms – if someone else uploads a copy of what you’ve uploaded, and gets more views than you, then that’s capitalism, you lost and it’s your fault most of the time.

      I hope you lose lots of sleep knowing that there are dozens of projects dedicated to perfectly extracting original-quality files from streaming platforms that don’t offer download options – I know because I am in a group where one has been developed and is being maintained – you’ll never find it because it’s secretive on purpose. Music starts there and then gets distributed to an exponential number of places until everyone that wants it can have it. You’ll NEVER win the war on piracy. All you’re doing is ruining the internet for everyone in the process though.

      Rant over!

  13. nealis said on May 12, 2023 at 7:48 pm
    Reply

    There is a few anti anti adblock filters that you can subscribe to for your adblocker. My favorite b/c of its effectiveness and update frequency is one crudely called “F_ck F_ckadblock” on github which have worked with every site that I know that has anti adblock scripts.

    1. Mike said on May 13, 2023 at 3:03 am
      Reply

      Ad-blocker-blocker-blockers and automated captcha solvers. What a time to be alive.

      From my perspective, the honeymoon with big tech is over. Maybe it was the whole not taking “no” for an answer thing; humans generally do not like this. (e.g. don’t want a Microsoft account and never will have one), or the forcing me to do work for them for free (captchas). Humans don’t like that very much, either.

      Now if only the US would stop big companies from monopolizing absolutely everything. Microsoft is consuming the game industry like a cancer, all the while claiming that they have changed and they only want what’s best for people, while simultaneously being more pushy with their Edge browser (which is just a Chrome rip-off) than any devoted cult members I know of.

    2. John G. said on May 12, 2023 at 9:12 pm
      Reply

      @nealis, imho the guy who named that filter was really affected for the anti-adblocks.

  14. Andy Prough said on May 12, 2023 at 6:43 pm
    Reply

    I’m more glad each day that I moved most of my video viewing to the odysee website a couple years ago.

  15. Someone said on May 12, 2023 at 6:40 pm
    Reply

    sponsor block and ublock does good work ;) so no annoying googled-things

  16. Anonymous said on May 12, 2023 at 6:06 pm
    Reply

    In uBO, I have some personal filters, but they all start with 2 vertical lines, like this ||
    Do we need to add them?

    Also, in Brave browser personal filter, if I want to add my own comments, what exclusion marks do I need so the browser don’t try to interpret them?
    Can I use exclamation mark ! just like in uBO, or can I use /* my comment */ ?

    BTW, does anyone know how to bypass the “Before you continue to YouTube” nag screen popping up when visiting YT for the first time?
    This Ghacks article doesn’t seem to work anymore by blocking cookies from consent.youtube.com including 3rd party.
    Or maybe I have to restart Brave browser, but I am using Ubuntu with Snap and it takes over 2 minutes for the browser to start up, so I have to try that later.

    https://www.ghacks.net/2021/04/01/here-is-the-easiest-way-to-get-rid-of-googles-before-you-continue-to-youtube-prompt/

    ps. Thanks Martin for the article!

    1. Anonymous said on May 15, 2023 at 7:58 am
      Reply

      Restarting Brave doesn’t seem to make any difference.

  17. boris said on May 12, 2023 at 4:32 pm
    Reply

    No prompts for me. Just in case, I tried few videos from different searches. AdBlockPlus and SponsorBlock work as usual.

    1. Anonymous said on May 12, 2023 at 7:53 pm
      Reply

      Its a experiment. Its not rolled out to all users.

      1. Anonymous said on May 15, 2023 at 4:16 pm
        Reply

        They said the same thing about removing the dislike button. “It’s an experiment”. Look what came of that.

      2. Bobb said on May 15, 2023 at 10:27 am
        Reply

        So was removing dislikes and look how that turned out

  18. upp said on May 12, 2023 at 4:29 pm
    Reply

    Google is getting desperate, they’re showing their shady.

    And this makes me believe even more the main reason for them introducing Manifest V3 is to kill AdBlock.

    1. Tom Hawack said on May 12, 2023 at 4:38 pm
      Reply

      Indeed, on a planet over-fed with advertisement and increasingly armed to block it, time is certainly not in favor of a tech company funded at 90% by ads.

  19. Fish said on May 12, 2023 at 4:06 pm
    Reply

    Not one of the problems described,
    none of the procedures suggested.
    So far.

    I’m testing raw MullVad Browser atm.
    I don’t use their VPN (or TOR).

    Thanks anyway for the article, which
    could be useful, hopefully, for others
    maybe still left (like me) following
    this web.

  20. Tom Hawack said on May 12, 2023 at 4:05 pm
    Reply

    YouTube videos/channels/playlists redirected to a ‘Piped’ instance : no ads and integrated SponsorBlock feature.

    Of course ‘Piped’ is only a front-end hence read-only.

  21. TelV said on May 12, 2023 at 3:27 pm
    Reply

    I think ads on youtube videos will only appear on those that are popular. I’ve been watching videos about the ongoing war in Ukraine just lately, but have never seen an ad appear so far.

    Even a video by Miss Monique which supposedly has 9.7 million views doesn’t include any ads. https://www.youtube.com/channel/UClIIy-aQBXRi1OHupBcrjJw The link was included at the end of a Ukrainian drone assault video I watched earlier and I clicked it because she’s good looking :D

    But it may be due to Firefox/Floorp coupled with UBO that blocks ads successfully.

  22. Tachy said on May 12, 2023 at 3:09 pm
    Reply

    Only rarely as I prefer text to videos but, I do use UB so I pasted those lines in.

    TY

Leave a Reply

Check the box to consent to your data being stored in line with the guidelines set out in our privacy policy

We love comments and welcome thoughtful and civilized discussion. Rudeness and personal attacks will not be tolerated. Please stay on-topic.
Please note that your comment may not appear immediately after you post it.