How to Block Adblock

Demo Download

If you are a website owner, there is a pretty good chance that you rely on some form of advertising to pay for your hosting bills. And if you are lucky enough to have more than a few people visiting your site, you might even be able to pay yourself a supplement to your salary as a compensation for your hard work.

On the other side there are the people that browse the web. They are tired of being bombarded with intrusive advertising, flashy banners and announcements that ruin their browsing experience. They don't need to be congratulated on being the millionth visitor of your website, they don't want to shoot five iphones, their only wish is to read what you have to say.

As it is much easier for users to hide ads than for the entire industry to develop advertising ethics, a simple solution quickly emerged.

Then Came Adblockers

The idea of an adblocker is simple - it is a browser extension that blocks or removes advertising on the page. A "solution" is hardly the proper term, however, as it only serves one side - the users. There frankly couldn't be a better deal for them. These extensions strip everything except the main content of the page, bringing a whole new dimension to the word free - it not only means that they don't pay; it now means that you don't get paid too!

adblocker-detected.jpg
Adblocker detected!

This didn't use to be a big of a problem for website owners - people using ad blockers weren't that many, and it did make users enjoy browsing your site more. But as the idea for browser extensions exploded in recent years, so did the proliferation of ad blockers. A quick look at the addon directories reveals that ad blockers are the most popular category.

Small sites are most at risk, as they can't attract the same interest from advertisers and experiment with different formats. With more than 20% of pageviews eaten away by adblockers (these are the number for Tutorialzine), it becomes evident that something has to change.

Miraculously, in the past few weeks there were news that the most popular ad blocker - AdBlock Plus will start allowing acceptable advertising by default. Judging by the uproar this decision brought, a large percentage of people will still opt in for complete blocking of ads or move to a different extension. This means that we as publishers will still have to maneuver around this problem for some time to come. One solution would be to detect the presence of an ad blocker.

How To Detect AdBlock

Update: The code presented here does not work any more, and any fix would be circumvented by ad blockers shortly after it is published. The issue of detecting ad blockers and in turn "blocking" them is controversial, as is proven from the comments below this article. This is why no updates will be made to this technique; I will leave it only for educational purposes.

It is simple - we will use ad blockers' overzealous interference against it. To block ads such an extension must look for files it believes contain code that shows adverts and prevent them from loading. So the idea is to have a JS file named advertisement.js, which will trigger adblock's filters, and after this, check whether the file has been loaded.

Here is the file itself:

assets/blockBlock/advertisement.js

jQuery.adblock = false;

That's all, one line. It creates a new property on the global jQuery object, which we will later look for. If it is undefined, it would mean that this file has been blocked from loading.

assets/blockBlock/blockBlock.jquery.js

(function($){

    if ($.adblock === undefined){
        $.adblock = true;
    }

    $.fn.showOnAdBlock = function(){

        if($.adblock){
            this.show();
        }

        return this;
    };

})(jQuery);

To find out if an ad blocker is present, simply do a conditional check for the $.adblock variable. In the same file, we also define a helper method that will conditionally show an element depending if such an extension is active.

Update: This plugin is also available on Github.

When including the plugin in your site, remember to include the files above after the jQuery library. For the demo page I am also using the confirm dialog replacement from last year to show a pretty dialog box informing the users they should disable adblock to view the page. Here is the code for that:

assets/js/script.js

$(function(){

    if($.adblock){
        $.confirm({
            'title'     : 'Adblocker active!',
            'message'   : 'You are running an ..',
            'buttons'   : {
                'I will!'   : {
                    'class' : 'blue',
                    'action': function(){
                        // Do nothing
                        return;
                    }
                },
                'Never!'    : {
                    'class' : 'gray',
                    'action': function(){
                        // Redirect to some page
                        window.location = 'https://tutorialzine.com/';
                    }
                }
            }
        });
    }
});

Bang! Now you can tell who is using an ad blocker. This simple method works with most of the popular ad cleaning plugins used at the moment.

What to use it for?

Okay, so you have a snippet of code that would tell you if a person is using an ad blocker or not. What to do now? Some ideas follow. I would not personally use any of the bad or evil ones, but I am obliged to share.

Good ideas

  • Track how many people are blocking ads on your website. If the percentage is high, you can try different (non-banner) types of advertisement;
  • Replace the areas of your website where ads usually go with some useful content;
  • Inform visitors how adblock harms small websites with a heartbreaking personal appeal ala Jimmy Wales.

Bad ideas

  • Show a big message that adblocked users are not welcome (like in the demo);
  • Beg for donations;
  • Replace with ads for affiliate programs that are not blocked by the extension.

Outright evil ideas

  • Set up a paywall for adblocked users;
  • Require a sign-in with facebook or a registration;
  • Redirect to a daily deal website with your affiliate link.

A bright future?

Hopefully the initiative behind AdBlock Plus' decision to show non-intrusive ads resonates in the community and we will enjoy advertising that is accepted and useful for both publishers and visitors.

What are your thoughts about AdBlock?

Bootstrap Studio

The revolutionary web design tool for creating responsive websites and apps.

Learn more

Related Articles

Very helpful article that I don't see a lot of people tackling right now, likely because some are worried it would make them appear greedy. In reality, it's a real issue. A lot of sites that become very popular take a LOT of time to maintain, and doing so 100% for free is not very fair. Free access to content on a hyper-popular website with the trade-off of one banner ad doesn't seem like asking too much, IMO.

p.s. I'm use Adblock in Chrome. The small block ads on your right panel aren't too intrusive, I don't think. I'm perfectly comfortable w/ manually adding sites like this to my exemption list.

zeroday1

I find it to be quite disconcerting that it should even be a question of whether or not the "end-user" is allowed to block content, especially ads.

WE ALREADY PAY FOR INTERNET ACCESS THROUGH OUR Internet Service Provider!!!

The idea that ad-blocking for the consumer somehow infringes upon the advertisers and a corporation IS ABSOLUTE RUBBISH!

It's just like that same college-professor on some TV-News bit the other night talking about how he believes that if people start saving money as opposed to constantly shopping, it would somehow hurt the economy.

Again this is such ridiculous reasoning...Regardless of whether people save money or not doesn't change the fact that we still need what we still need, not necessarily what "we are told we want!"

People are still going to need to buy their Milk, Bread, Soap, & Toilet Paper! --- These necessities will always be just that---NECESSITIES---and people will always need to shop for these things.

Isn't it enough that we already add stuff to our shopping carts at the grocery store when it may not even be on our shopping list?! ---Evidently its not according to what these advertisers would have us all believe!

It really is sad when you think about all the efforts people are expected to put forth just to claim what is already rightfully theirs.

The Corporations, Advertisers, & "Certain people whom are probably paid to say half this nonsense" and expect to somehow make this all seem acceptable to the consumer are at the same actually imposing unnecessary restrictions on consumers freedom to choose.

Most of us would frown upon the deleterious behavior of an uninvited person that may come to our home and threaten our peace for example, but when advertisers do it they are excused for their inimical actions?!!

Please!

I mean really, why we should expect the advertisers to come after us, when really they should be going after the Internet Service Providers whom we already shell out too much money to for our internet access.

Is that really asking too much...when we already pay through the nose for our internet from these ridiculous monopolies to begin with, all of which hit us with an already enormous amount of advertisements before we even get the opportunity to read our emails...I mean really...when is enough going to be enough?!

Do we really think that they will draw the line if we don't?!

In my opinion, it is all just one big sham---I mean scam---I mean...you know what I mean.

What’s next, are we going to be fined by some sort of new advertisement police the next time we decide to avoid looking at a bill-board on the side of the road?!

Please! Give me a break...who do these people think they are kidding?!

Famous Quote by JFK:

"...We decide long ago that the dangers of excessive and unwarranted concealment of pertinent facts far out-weigh the dangers which are cited to justify it...Even today there is little value in opposing the threat of a closed society by imitating its arbitrary restrictions...For we are opposed around the world by a monolithic and ruthless conspiracy that relies primarily on covet means for expanding its fear of influence...on intimidation instead of free choice...It is a system which has conscripted vast human and material resources into the building of a tightly knit, highly efficient machine..."

http://www.storyofstuff.org/

http://thetruthisnow.com/headlines/consumerism-money-worship-the-greedy-immoral-human-conditioning-video/

You are confusing two entities here ...
your internet service provider, and
the person who creates the content you devour.

Why should someone be willing to create good content for "free", if they can't somehow be compensated via affiliate links and adverts.

These have NOTHING to do with your internet service provider.

"Why should someone be willing to create good content for "free", if they can't somehow be compensated via affiliate links and adverts."

In most forums, the users are also the ones, who make the content. So basicly users should get rewarded?

Sorry for bad english.

Henrik Pedersen

Except that on forums people are mostly doing it to discuss their own opinions (call it ego boosting or for own personal gain, whatever) and the quality of content is generally lower than on dedicated blogs. Still not quite as low as Youtube comments, but still low.

I think it's fair that site owners use advertisements and I don't mind Google Adsense. But I think the idiots of advertisment (both advertisers and publishers) are ruining it for everybody else. I run AdBlock with no exceptions because of those "shoot 5 iPhones", flashy banners and also the most annoying: The ones who fake the user interface of the site they are on.
On most downloadsites there are 50 download buttons, where 49 of them is ads, and only a single one is the actual download. Use Adblock, and there is only the download button.

I don't know what the solution is to be honest. I think that releasing quality content and then providing paid premium content is the easiest way to go for both parties.

I'm amazed at how so many web users somehow feel that they are doing a site owner a favor by turning up on a page with adblocker.

I will bet you a dime that 99% of these people never have and never will go into the huge process that is setting up a website full of quality content. They have NO idea on what's involved. Yet they somehow feel they have the right to attack any website owner who complains that they are losing revenue from adblockers.

So many are quick to proclaim "If you don't like it, I'll go somewhere else!"

Bear that statement in mind....

Which translated in a website owners mind means "Keep the fridge (website) stocked with food (content) and never expect a dime from me towards the grocery bill (web hosting etc) and if you don't like it I'll stop coming over to your house to eat"

They block ads, affiliate links, and youtube ads. Yet they still somehow believe that the content will still be produced endlessly for free.

I have seen rant after rant on the adblocker forums declaring that affiliate links are wrong and how they need the Affiliate I.D. stripped from the link url. I have also seen posts there on how to do this manually. All backed up with statements such as "They shouldn't make money from this, I hate them making money, its disgusting!"

Think I'm joking, head over to the adblocker forums and look into what they have to say about affiliates.

Well, to finish my point.

It's July 8th 2013 and as I write this post Youtube is rolling out paid subscription channels. Its started with some big names but has declared that they intend to open it up to many more independent content creators.

You know the ones everyone enjoys watching, millions if not billions of channel views?

Subs run from 99 cents a month to $7.99 I believe at this stage.

Reason?

Due to huge drop in ad revenue from adblockers.

I know some website owners with HUGE amounts of traffic, due to the large amounts of quality content they produce, who are a couple more bad months of ad revenue away from going to paid subscription. They have done HEAVY research into if its viable. It is, and although they expect a large drop in traffic, they expect a large recovery in revenue to pay their writers/staff etc. They are currently waiting to see how the Google/Adblocker whitelist affair turns out in regards to revenue stability.

I've heard adblockers use the phrase "If you can't run a website without ads or affiliate marketing then you have a broken or outdated business model"

This is true, so under your evolve or die system, evolution is pay for content.

I know several other website owners who are going to maintain free websites but are putting premium content into either ebook/kindle form and charging or putting it into a monthly paid subscription email newsletter.

So there you go.

The seeds are sown.

The free content soup line is running out of volunteers to serve up for the masses. One by one. Day by day.

So when the inevitable screams of "I'm not paying! This is not fair!" or "I remember when the internet was free" start rising from the adblocker masses.

I will sit back, laugh, recall what they used to state and say.

"Well if you don't like it, go somewhere else!"

People don't have to create content for free and ads are a good way of getting paid for your trouble, one of several ways to get something out of it.

On the other hand, why should people browsing the internet be subjected to the thousands of potentially malicious adverts out there. Most of the virus hits I've had the past five or so years have been from ads and until I see proper guarantees that there are no malicious ads about, I will continue to use and support the creation of ad-blocking and anti-anti-ad-blocking plugins and tools.

Instead of complaining about people using ad-blockers, why not complain about the ads people are getting through the various advertisement embedding on websites that makes people want to block them. Get rid of malicious ads, get rid of the ads that start shouting over whatever your streaming, get rid of ads with excessive "skip ad in: ....." timers. Do that and people won't care one way or the other about blocking them.

By "fixing" ad-blocking, you are not fixing the problem, you're attempting to break the workaround of the problem.

The internet was designed to FREELY let people gain information and knowledge.
IT was not designed to track, steal, con, deceive, ad malicious coding to websites. Doing so is illegal, a criminal activity.
Supporting it, enabling it and distributing coding hat interferes with intent to stop someone from seeing the information displayed is criminal.
Websites steal information, Google steals information, using the proceeds is criminal.
Therefore you are a CRIMINAL and all CRIMINALS eventually meet the just end.

Am not sure how you came up with your reasoning about online advertisements... just because you pay money for your ISP does not mean the creative people online who create stuff for you to enjoy will get something from it!

without source of revenue, they will stop...and you will only live life of getting stuff from your grocery... what about movies? Tv shows? video games? etc etc..they are different... if creative people can't make money from it, they will simply stop!

Do you know why some people keep posting amazing videos on youtube? cuz they get money from ads... without this source of revenue they will simply stop and start working in grocery for you!

Now everything shifting to internet! and a main important source of making money is through seeing ads.. or paying in subscription..
pick your choice... at the end you won't get everything you want without something in return..

blocking ads and promoting this kind of thinking will only harm others in long run.. when you make others happy, you will be happy at the end as well.. but doing stuff that only makes "YOU" happy by blocking ads and ignoring other people/companies needs.. they eventually won't be happy about it, then they will resort charging you using subscription.. at least in ad supported content you can still see content for free...

I didn't realize the driving force of creativity was money. That helps explain most of the nonsense put onto the internets. I know you only gave me two options: Paying a subscription, or looking at irritating ads.... I will chose a third option wherein I keep blocking ads and not consume purely profit-motivated drivel. I don't understand why every half-whit with a website feels they are entitled to my money....If you don't like the money you are making you should probably find another line of work. I hope the many banner-ads in your future really do bring you happiness.

Let me ask you a question. Would you work for free? Would you spend your entire day at any company, it doesn't matter, flipping burgers, pumping gas, designing architectural plans, or doing whatever, if you never got paid a dime for it? These content creators need money to get by, to pay bills, buy groceries, and also to make the websites that you visit. Besides, you're not paying a dime to them, unless you work for an advertising company, which would be confusing since you use adblock.

This argument isn't for you since you seem to be set in your selfish ways, but to anyone else who reads this. I'm not a content creator myself, but I believe that the people who work hard to provide content should be compensated for their work.

I honestly don't know why you make a distinction between grocery stores and ad-driven websites. The two are basically the same when it comes to economy. Grocery stores won't give you anything for free, so why are you ok with that? On the internet, you can consume YouTube videos 24/7 FOR FREE if you want, yet you sit and complain about the "oh, so annoying ads". It is thanks to the ads that YouTube or any other site don't cost you 20-30 bucks a month to visit. Since you, like most other communists on this planet seem unable understand how the world works, I'll state the above line for you again:

It is thanks to the ads that YouTube or any other site don't cost you 20-30 bucks a month to visit.

Hope you got that. Write it down. Read it everyday before you go to bed.

Npersson

Saying that users have the right to block ads because they already pay for internet access from their service provider is like saying "I don't have to pay for my gas because I already bought the car" or block the television ads because you bought a TV. Just saying...

You know what? I've got news for you: users pay for their bandwidth too.

When I'm tethering on my phone and I browse a page with 20kb of possibly interesting text and 3 videos in auto-start mode, plus on top of that a few glossy images for shitty stuff I've got no use for, the signal over noise ratio becomes infinitesimal. If I were to allow this, I would need 10 times more GB per month, which believe it or not, I pay for.

Soooo...

1/ I'm using adblockers and would even develop my own one (or grease monkey scripts, or have heavy offender domains sinkholed) if it were to "soften".

2/ When intrusive popups come in the way I nuke them with firebug or F12 in a matter of seconds.

3/ If the sites set up road-blocks to their content through redirection with some ad-block detection mechanism gateway (like Forbes), I just skip. Is not reading Forbes pages going to change my life? No! They all get their news from Reuters, AP or AFP. So the same article is available on another site - often verbatim. Forbes have just paid Google News to be the first of the list on that topic.

If by chance I come across users who haven't equipped their browser with ad-blocking SW, I can measure how happy I am. What a load of rubbish they seem to endure... I feel the same compassion as if a see a dog with a broken leg.

In my view people put content on line because they have something interesting to say. If they just do that for the money, chances are that content is just a bait and probably not worth my time.

The fact is, I've seen the beginning of the internet when you would have no more than one or two emails per day, when all you had to sprite up your web pages were animated gifs, and when 90% of what was put online was done so without the prospect of churning out huge ad revenue. Since this lost Eden time, ads have only gotten more and more aggressive, intrusive, even sometimes offensive. So savvy users have taken measures, for themselves and on behalf of their kids.

And now we have webmasters coming up whining on the theme that this dents their revenue. I'm trying to shed a tear. I have a lot of content on line as well. But I'm not in this for the money... I never was.

By the same reasoning, consumers should - at the expense of their life expectancy - carry on eating junk food otherwise it will be the end of the likes of CocaCola and McDonald on one side and of the statins pharmaceutical industry on the other hand.

Sorry guys, ad-blockers are possibly a webmaster pb but for mankind as a whole, it's probably a good thing. Even the nifty jquery trick shown in this article will not turn the tide. In the end ads are supposed to land on my screen. And by definition, I will always be in control of that end of the pipe. I will always be able to manipulate the DOM or control the scripts. And the more aggressive the ads, the more incentive there is to do so - same old story.

Another issue and the reason that I use adblock is because some of the latest viruses come in through advertisements. With the number of sites I go to on a daily basis, adblock is my first line of defense.

For example, there was a virus recently that would load a small file/cookie/whatever. Nothing happened until you closed your browser and came back in later. That was when the virus was triggered.

With so many sites serving up ads from advertising companies, it's hard to know. Even if a site is trusted, if that site is using an infected ad server (accidentally), the best intentions in the world won't save me from hours of work or a complete re-install.

If a website wants to link to another site or service, put up a banner, make a link, and collect that way. Taking the easy way out by injecting advertiser code is the problem. Besides which, not only is that another request while the page loads, you are allowing another company to dictate content on your site. That could have all kinds of consequences to the user and the owner of the site.

So, want to get paid, include them like I mentioned. Win/win. Your ads don't get blocked and I don't have to worry about what they contain. The situation you provide has the potential to be one sided. You included positive things to do, but there are an equal number that weren't mentioned that could be bad.

A little food for thought.

Kevin Vandenborne

Want to block adblock? Quit naming class names "ads", "sponsor" or similar stuff, dont name images/urls/html comments/etc.. "ad",.. . It's as simple as that. To avoid getting your ads blocked automatically, you should first do some testing and se eexactly what it is that makes adblock remove your ads. Many, including me don't even block ads that aren't automatically blocked unless they're extremely annoying.

Figure out what annoys, do some polling, etc. Personally what annoys me is flash ads, words that appear as links in content but that are actually ads. Basically flashy annoying things and stuff that tricks you into clicking it.

Jogos de Vestir e Maquiar

Thank you very much for this counter-adblock!

I'm the owner of a site in portuguese that has a lot (a lot) of visitors from Brazil and not as much ad impressions as it might have. (site on name)

Since it's a site for kids... do anyone know if some "parental control" software has an ad-blocker included? (and popular in Brazil?)
If not, I might have another problem I'm not aware...

Anyways, I will try the ad-blocker you made! Thanks once again!!! Your work is really great!

Marcos

ps: sorry about my english!
ps2: thanks again!!!

If you clic on "Never!" and use the "back button" the Popup will never appear again...Is that a bug?

AdBlock is great. It makes ugly, unusable websites full of annoyances less ugly and usable again. And, since I will never, ever buy anything from an ad or click an ad on purpose, it removes a lot of the pointless fluff that is completely irrelevant to me anyhow.

Luckily, this malevolent code of yours can be stopped with NoScript. If your website somehow needed JavaScript to function, and then I was met with an anti-AdBlock message upon enabling JavaScript, I would immediately close the window and be sure never to visit your terrible website ever again.

TL;DR: Let the users do what they want to and stop acting so entitled.

Well Kyle, and how do you suppose the websites you visit pay their bills then? Actually, I think websites are pretty happy to see a selfish user like you leave.

Gonna have to side with Ferdy. I'm all for finding less annoying ways, but people who offer a lot of free stuff need to pay for hosting and other expenses. You can't just expect loads and loads of quality stuff for free if the author doesn't get at least something out of it.

In the end, expecting free things from people and not thinking they deserve anything in return, is you acting equally entitled.

Tavoidogoido

i totally agree with you i have a file hosting site and the only revenue i get is the ads and the premium user subscription. But my site is practically new so for the moment my only revenue are the ads. I dont open popup when a user downloads the files so my ads arent annoying. But i also agree that some ads are annoying like the ads on the videos of youtube.

See Ferdy, the revenue conundrum is for the webmaster to solve, not the end user. Like it or not, you can't compel people to look at ads. To try to force them, when they have chosen not to, is utterly wrongheaded and counterproductive.

This is not a moral issue, it's just the way the web works. The big stick approach won't change people's attitude to your site any better than criminalising customers is working for the film studios. If you cling to an outdated business model, expect to fail.

It's not an outdated model. Advertisements are effective everywhere, and the only reason users feel that it is outdated is because they're so up in arms over the days of really bad advertising. Just like there are bad websites, there are bad advertisements.

You can have a good website AND good advertisements, and you'll be much more effective than a good website with bad advertisements...

Additionally, you're correct that it's for the webmaster to solve and not the user. I own the website, I make the rules. If you're going to choose to block my only source of income on the site, then I have no use for you viewing my website.

The fact is, the web works as so. Users want data, users search for data. Webmasters provide data. If the users are going to continuously be greedy and act entitled, then the webmasters can just as easily remove the data.

Providing code like this allows webmasters both legit and non to continue controlling their websites. Which is why they are webmasters in the first place. Users need to get in line.

It is not really that a webmaster wants a user to look at the adverts, they want the impressions.
Using an adblocker is not a good idea. If you do not like what the site does, go elsewhere. It is that simple. Using an adblocker is like going to a talk where you get a gift after the talk, but you simply go in and steal the gift and walk out before the talk begins.

Here is one example from a free website that we run out of our own money.

Adverts per page 3-4
Monthly impressions on website: 166'000
Monthly impressions for adverts on website: 16'000
That is 9%, but we have 3-4 ads per page, so when you work that out, you get a max of 5333 advert impressions per month which is just 3%.

There is no other business in the world where this would be classed as acceptable, but on the internet, which I call "the new wild west" it seems perfectly acceptable.

The entire push behind the usage of adverts came from users wanting to access content without paying to access. Now it seems that we are going back to a pay to access system due to the usage of adblock along with people avoiding being tracked so that we can improve our website for them. The whole thing is completely insane and is fuelled by fear of the unknown.

You don't need to buy anything. Just leave the ads where it is. Done. You help the website much.

The counterpoint would be that users who expect content to be created without compensation, are the entitled ones.

Eli Mitchell

I see neither the advertisement nor the pop-up dialog box with Opera + Ad Block.

Martin Angelov

Yep, it doesn't work on Opera. As far as I tested, their extension is more permissive than the other adblockers.

violacase

Because some things are possible does not mean we have to DO some things.
If you respect someone's choice for having an adblocker DO NOT use the techniques you describe. Let them live in piece.

"Let them live in peace" means freeloading of the hard work of website owners. It's not a sustainable model. If you think all users should be able to block all adds, what would be your answer on how website owners get paid? Or do you think they shouldn't?

violacase

Why does everybody think the WWW is meant for making money? And sure there are other ways for making money than just annoying your visitors with unasked advertisement.

Richard Bland

Got to agree with you on this one. The net to me may have been made to look like one giant money spinning device but I believe it has the potential for so much more; something not tied in with making money. (although reality often states that if there is money to be made from peace or war, they'll do both).

Thats not the point, without some kind of money coming into the webmasters pockets, most websites would simply not exist. It dosent mean everyone wants to be insanely rich thanks to the users, its just that not everyone has thousands to spend on a website they have to maintain, just because users cant bear to see a couple ads.

Exactly.

ok, what if adblock blocks the .js file?

Then you wont see the content.
The whole point of the script is that it has to run in order to tell the site that there is no adblock. If the script is blocked the site knows that adblock is running.

The way to get round this is to let the js file past the filter.
Simple, let the js run, keep blocking the ads..

This block works due to overzealous filters.

Hey guys, if you read through the whole tutorial, most of it is on using the js script to detect the presence of Adblock.

The author suggested tracking blocked ads as part of your site analytics which I think is a good idea. It just happens the demo he used showcases a big popup.

Cut him some slack, he didn't tell you to do some terrible to your site visitors using adblock.

AUDIOMIND

Any website that installs this adblocker block will immediately be sent to the black hole here. The end user of your website is king on the web. Forcing them to view ads they have went out of their way to block will send people far, far away from your website quicker than you can press the back button.

ToAllTheKyles

I dont see the problem here. Why would a website owner care, the visitor has no revenue attached to them. They bring nothing to the site.

Sidenote: do you understand the concept of advertising? It is set up to bring revenue to media and content delivery. Newspapers, magazines, television, even movies have used it since their invention. Compare huffingtonpost.com to a free site and see if you notice any shift in quality.

Do you really think webmasters are going to sit around and say "well, I didn't really need to profit off this site anyway! Lord, I was so wrong to want money for things I've created and written! How selfish and capitalistic of me."

No, in fact, they will just remove the google ads, replace them with new undetectable affiliate ads. SO what happens is instead of getting Google ads that are catered to you specifically based on your searches, you are going to get random things all over your sites that make no sense and don't apply to you. Brilliant. You lose, webmasters lose, the content becomes terrible.

cronowebmaster

This solution is not viable. For example, i use the latest ff with the latest adblock and no additional plugin, but this solution is not working. And if you use noscript, it's more than useless. It's a nice try, but sorry...

Andreas Krey

What the world really needs is an adblocker that simply sets all ad space to invisible (and minimized). Ads still loaded -> Site happy; don't show -> User happy.

In that design users and webmasters are happy, but the advertiser gets the shaft.

Except that the advertising networks that I've seen pay-per-click, so it would be just as bad.

This plugin does not work with some of the many ads blockers I tested it with, it did not detect some of them like Kaspersky and did pass the test with flying colors.

It also is a real bad idea to use this on any website if people not care for your ads they will be really pissed off with your anti ad blocker popup and your losting there views as well. The best way to deal with ad blockers is replacement msg on the space where the ad shows like wowhead.com does I think.

Ryan Doss

If I were to use this I probably wouldn't even put the "Never" button as an option lol.

I prefer "Flash Block" - It gets rid of the annoying ads : )

I use adblock without any list. I block ads myself. So unfortunately your adblocker doesn't work. Too bad :(

Richard Bland

You may have done something dirty here Martin! LOL ;-p

i hate ads, but i can see the other side too.
this could be used as a one time popup when you first visit a site, and ask users to give a chance to your site. i thnk many will put your site on a whitelist and if you keep your ads unobtrusive, they will not put it back, or leave the site.

ad blockers are good. they keep shameless animated ads at bay.

those sites who have non annoying ads, will be safe.

My thoughts on adblock is quite simple, if it flashes, if it begs for a click it must go, if it's clean and tidy with 3 small lines of text like google text ads, then of course I will welcome them as those are so neat and tidy that they don't make my eyes sore - PLUS google has a limit on how many we can put on our site.

the number 1 problem I have with ads is there are 6+ advertisements on 1 page that just are all over the place and you can't tell the difference between a advertisement and the content then it has to go!

similar to TV advertisements... there's a restriction that needs to follow and there should be a board to actually control the methods used so that people don't get scammed or bombarded by people who can't think how to do a real promo for a real business.

I appreciate your effort to help site owners but as reader i got virus injected many times by some blogs. Also blocking people, who have adblocker installed is bad idea. People will just move on to another site, unless it is very important to them.

Why do you think we use an ad blocker in the first place?!

Do not block ad-block!
Providing information is good but do not use advertisement. You won't benefid good from it!

F U all and i'll figer out ways to block the adblock blocker!
:@ Arhh! stupidos!

Shahinul

It's not working with my customize adblockers and system host file (where bad sites are blocked as on localhost domain). Anyway I prefer not to surf on sites who have many ads infections if I can not use my 2 adblocking plugins.
It's not good to have a web page disfigured by ads, heavy loading and nerve stress for surfers. Those ads are bigger problems than adblocker. If they would not exaggerate with ads then adblocker won't be need it.
There are some sites (common sense ones) where I disabled my adblockers.

I found a way to bypass it. just hit "back" on your browser when redirected.

As a web site owner it costs me around $300 a year for unlimited hosting, then all the hours I put in and the content that I purchase and content I produce. This is all very valueable. I put all this together and give my product away for free. This gets my site more traffic. More traffic generates more money from my ads on the site. I use the money from the ads to buy new and better content for the site. But with the ad blocker in place it really puts a stop to this improvment cycle. Their is not much incentive to invest time and money into making a great product and receiving no return on your investment.

Very interesting. AdBlock allowing unintrusive ads is a sign that AdBlockers may after all force a code of ethics on the industry. I wouldn't install an adblocker for small Google Ads, but a screaming skyscraper ad for a trip round the carribean next to an article about the earthquake on Haiti? Seriously?

On the other hand, people who click "Shoot five iPhones" ads or Millionth-user-ads may not be part of the same demographic that knows about and installs adblock extensions. Or use a browser other than Internet Explorer 7.

I agree that displaying a message like in the demo would be a very bad idea. People with less technical understanding would a) feel spied on and b) be too pissed for you spying on them to click any ads at all.

AdBlocker

Thanks for your nice demo!

Now as I know how adblocker detection works,
I can quite easily disable it by simply allowing the
adblocker to load the advertisement.js file.

For example, in AdBlock Plus, I added the filter rule

@@||tutorialzine.com/*/assets/blockBlock^

and now the annoying "Adblocker active!" popup is gone :-)

ThePigster

I wouldn't even use an adblocker if there weren't so many annoying ads that autoplay a video or expand when the mouse moves over it. Advertisers have shot themselves in the foot with such annoying ads, and greedy site owners have allowed it, so they are as much to blame.

I feel bad for small sites with a few simple banners that will lose advertising, but no one is annoyed by those ads enough to download an extension that blocks them. I tried running without an adblocker for a few weeks, and I finally just couldn't take it anymore. The autoplay videos were the worst culprit, and they are very common across the web.

Until some ethics are brought back to the industry (if there ever were any), I will continue to use AdBlocker. These webmasters don't seem to be aware that they're supporting a corrupt industry by allowing misleading and disingenuous ads on their site. I just started a blog and don't have any ads. Never will. I don't care how much money I'm potentially missing out on. There are other incentives besides money.

Demiurge

Is there way to detect a detector and block it? I found this full disclosure very scared me.

NoScript. When I visit that site, I get nothing coming up.

And here it goes directly into my bookmarks for future testing, thank you!
Internet users have to realize that a website is owned by a webmaster, he can do whatever he want to do with it and people well either they stay or they go.
Serious webmasters produce valuable free content for their users and put non-intrusive ads. What are internet users doing ? Do they respect webmasters? Yes most of the time.
What will happen if the business model based on advertisement falls down?
If webmasters can't get money to pay their site's bills, I won't be suprised that in a few years we'll have to pay to get access to some websites.

After reading and re-reading this tutorial, a central question still remains: What are the specific steps I need to do to add this to my site?

Name (required)

The internet is nicer without these ads. I stopped using TV because adverts are on every 15 bloody minutes and video adverts on the internet are becoming really annoying since they are not always blocked.

Webmaster owners complain that they don't earn money and users should put up with any random ad they can find to make money or not use the site. Well how about you stop trying to waste my bandwidth with shitty/generic ads that load before everything as that wastes my money? It's my bandwidth so I chose what content I download with it, not you.

Good luck on blocking adblock users. Thought I don't see that as the best fortune for you. I find that ads which directly talk about the topic in question and are a smallish banner on the side are unoffensive and I don't go out of my way to block them so I suggest trying that. Though as R McK said "If you cling to an outdated business model, expect to fail." Maybe the majority of users are still behind with you but they won't always be as the newer generations are more tech-savvy than ever.

concerned

Why pester people? Money is not a defense. Find a better business model. You are a reprehensible individual, and are making the world a worse place.

I am sympathetic as a website owner with hosting bills to pay for in addition to the time and effort it takes to provide good content. It isn't only a matter of hosting costs but the cost the user/visitor might not be aware of. The tools of the trade being purchased to create that content is an additional burden to bear. I paid for and did not pirate my photoshop and I'm not a student. I have other expensive software that I paid for. I have two very expensive cameras and that's only for starters.

I believe it's fair to run 2 or 3 unobtrusive ads that don't ruin a visitor's experience. I've even asked visitors not to enable adblockers or to disable them if they are using them. I explained why in a blog post and saw an increase in ad revenue following it.

The problem is two-fold. It's selfish for a webmaster to think solely of his bottom line. Obtrusive ads, particularly the flashy and large variety which are very popular, are a turn-off to visitors. The last week alone was proof enough to me of how many webmasters are ignoring the purpose of offering content. If you are offering content for free or you are offering premium content or even both, it's not in your best interest to turn off people by placing large and/or annoying ads on your website. This contributes heavily to bounce rates. A webmaster has precious seconds before someone decides to close the tab/window. It's better for them and you to spend those seconds viewing the actual content as opposed to being annoyed by ads especially if they cause loading issues.

Another thing webmasters don't like to admit is how so many of them do not take measures to ensure that "safe" advertisements are on their websites. Several people here mentioned that. It can be dangerous to visit a website, noscript and ABP are a must for me. I've had several bad experiences which compromised by security. I prefer to be proactive than be a victim.

My policy is that I enter new sites cautiously. I keep the ads blocked and don't allow scripts until I have a look around. If there's something I am considering downloading, I will investigate the site a little more. If I deem the site trustworthy especially after having scanned the goodies I've downloaded, I will disable my adblocker. That is fair.

I hate leechers and the internet has become a leecher's lair. It isn't fair at all to get quality content and not contribute anything. I've seen sites with 2000 downloads for an item and 3 comments. If you add visitors enabling adblockers to the mix, it's impossible to argue that those users aren't selfish, greedy leechers. To those who say "well that's just too bad" or "it's your problem to fix", you're part of the problem because your indifference doesn't help. Contrary to popular belief, the internet is not free. Nor should it be. Both webmasters and visitors should accommodate each other within reason. C'est raisonnable non? Stuff costs money. Aren't you paying for the internet service you're using to browse this site or are you leeching from your neighbors wep router?

Is there a way to block AdBlock on one part of a site, but not the rest? I just disovered one thing that AdBlock does, which can cause problems for online radio. Since I use Adblock, myself, to block flash ads which can bring malware into a system, I found out, when acessing my own site, then when I clicked the Live 365 stream link, that something in AdBlock caused the stream to launch inside my page, instead of going to the Live 365 page first. DMCA rules and the Live 365 TOS require that the user be taken to the Live 365 page first, before the stream lauches. I need a way to block AdBlock on the section of the site that links to Live 365, but not block AdBlock on the rest of the site.

powerthazan

Now code doesn't work in Google chrome!

This scritp is no longer work!

This does not function properly in firefox 15.0.1. You dont get the popup telling you to disable adblocker. :(

Designersblog.net

This method doesn't work anymore. I've made my own simple methode and WordPress plugin out of it. You can check it out here: http://wordpress.org/extend/plugins/adblock-blocker/

  • Cas van Dongen
Hariharakumar

Need to try this one. Is there a similar script for blogger/blogspot blogs?

the provided solution is now obsolete and not working. can you please update it for present browsers

Hi.
I was planning the "Bad Idea": "Replace with ads for affiliate programs that are not blocked by the extension."

Why is a bad idea? Maybe I'll loose some visitors that don't like ads but maybe it will be worth with the money I won with the other visitors that will accept it.

Good blog.
Thank you!

Not working

This script is interesting but i disagree with it.

The reason someone is using an "Adblocker" is that he doesn't want be bothered by commercial messages, spammers, popups, and such things while he is browsing the web.

So, this annoying "popup" or "lightbox" thing you toss in his face is not good in my opinion. If you want tell him you need a donation or some money, you can write real content in your website, make offers, deals etc... You can do it without banners. that's it.

This script is weird, i don't understand it, let's see a real world example: it is like you are wearing sunglasses, and when you go in a shop, the shopkeeper asks you something like "you can't see my products! take off yours sunglasses please!", well this is ridiculous "MY sunglasses is MY business! I decide what i want see, and how to watch things!".

Too bad it doesn`t work anymore. I would have used it for sure...
AdBlockers ruin the internet. In some time you'll have to pay for youtube, google and other awesome sites.

I think it's the fault of some stupid Webmasters some time ago. They added ads with blinkblink-effects which nobody ever will klick on. They're just too annoying. Because of these fools Affiliate Marketing will soon be history. Too bad people don't understand that they are about to kill the internet.

doesn't work anymore

you can manually check the height of ads within a div 'someclassname' and detect the height of this div with JS after pageload; when the height is 0 then they're using it.

Vesselin Obreshkov

I very much like your Outright Evil Ideas.... hmmm evil grin

The whole discussion neglects one portion of web users. Us. I mean, you and me and the other 10%, lets call us the web 'power users'. The users who know about the whole business model, accept it but still have NEVER in their life (or at least in the past 2 years) clicked an ad. @Martin Angelov: Do you remember when you clicked your last ad? I don't. And just because my favorite web site now forces me to disable Adblock - I still won't click an ad there. I'm sorry, but the website owners didn't make money with me before and they won't if they force me to enable ads. If I want to buy something, I'll google it and buy it. I might have seen an ad for it on some website that forced me to disable Adblock, fine. But I didn't click the ad. So the company that put up the ad got what they wanted and the website owner gets nothing.
So maybe the whole ad business model sucks. I doubt that it actually works for the pros.

This doesn't work anymore, is there an update for it?

Cooktheman

I would stop using adblock if websites would stop using deceptive ads such as what is supposed to be a link to information on a topic on the article you are reading that instead takes you to some product that has nothing to do with it maybe I might disable ad block. If websites would stop using underlined blue words on the majority of the page that pop up small adds when you hover over them while just trying to scroll down the page..I might stop using ad block. if web sites stopped using small video ads with volume set to max that I can not at least stop. I might stop using ad block. if web sites would stop filling the Whole fuxxing page with adds I might stop using ad block. if web sites would stop with the flying across the screen add and find the damn x I might stop using ad block . If companies would respect my right to not phone my house or cell phone I might stop using ad block. If DVD/ Blue Ray would stop with the pre ads before I can watch the movie I FUXXING paid for I might stop using ad block. but until we get some regulation on ads and acceptable forms so as not to ruin the internet experience My ad block stays up.

codeclan

Try this plugin. It works very well.

http://wordpress.org/plugins/better-stop-adblock/

Let me give you a real world example from one of my web sites : http://photozoe.com

This is basically a free online photo editor that allows anyone to upload, edit, save, and share their photos. On average their are about 20,000 unique visitors to this web site daily & each visitor uploads at least 1 photo which is between 2mb-10mb, edits the photo and downloads or shares the photo.

This costs me storage space, and bandwidth, and i expected to pay for this and maybe make a little extra from ads, however almost 50% of my users have adblock and out of those who don't less than 1% of the visitors click on ads. It costs me more to run the site than I make on it.

So I figured I would ad a donation button which gives visitors extra features and no ads. Out of the past 2 million visitors, not one person donated.

I don't collect email addresses or even require a login, so I am there are no privacy concerns.

So WHY should I continue to offer this free service if it is only costing me money to run it ?

If you are offering the service to earn money from it, then you need a different marketing model. You can try to sell the functionality you have developed to some other company etc. But it should be pretty obvious that you cannot force people to look at the ads on your site.

I can understand that this is irritating for you, and that it might mean that you must change how you go about things. Loss of income is not fun.

I hate ads, people don't like ads. I have no problem leaving a page if I see too many ads. Running AdBlocker makes the internet suddenly look a whole lot more cleaner and similar to what it used to be in it's infancy. Another discussion I feel is totally lacking here is how much information advertises can collect about the "surfer" just by him requesting the ad-url.

I tell this to anyone, if you use google or any other free service, then YOU (the user) are the product and that you are giving away information for free. In the end, would you really give up that much information???

Messenger

A bit late to the party but on the off chance that an "advertiser" or site owner might end up reading this, it'll be worth my time.

When I see ads, when you try to shove product down my throat, I consciously choose to forever ignore those products. I'll never start a site with squarespace or buy an audio book from audible, or donate money to Firefox. Why? Because, as a somewhat intelligent human being, I despise those that try to manipulate me.

Market smart. When shopping, I will buy what I need AND what I want. Does annoying me with uninformed, uninteresting ads entice me to buy your product? Nope, not all. If anything it helps out your competition, even if only because they didn't try to get in my face.

Hi Martin,

I am using BlockAdBlock Script in my free presentation templates resource to deal with visitors using ad blockers and plan accordingly what to show instead or fix the layout to improve the user experience.

To be honest, I have found a very high percentage of users using ad blockers in 2015. I guess the trend will continue in 2016.

I am Julian from SlideHunter.com

Here's a question for those of the "web/content owners need their ads un-blocked in order to make money" argument:

With the number of people using adblockers soaring, how are the numbers of websites and ads continuing to increase exponentially? Your argument is that advertisers and webmasters are facing an avalanche of adblocking from end users, when the numbers say that the opposite is the case, that end-users are attempting to stave off the growing tsunami of ads and commercials that can turn a :30 check of news headlines into 3 minutes of compulsory bombardment.

The problem is when all the independent websites go away because there is no chance of any revenue all that will be left is google, facebook & youtube to lead us in cultural wisdom.

That sucks. One comment above said 'with adblock the Internet is more like it used to be', however the picture it is leading to is not so pretty.

Mike from an ad agency that provides relevant ads.