How to Ban or Block Users of Adblock and AdBlock Plus - V. 2.0

Adblock User Block screenshot
AdBlock image

This article shows how webmasters can ban and/or block users (visitors) of AdBlock and AdBlock Plus. Though there are several techniques, this is one of the easiest, simplest and most effective. See also our Javascipt No-Script User Blocker

Why ban users of AdBlock?
Simply because you can! No explanation needed. Webmasters, bloggers, and companies spend countless time and money generating web page content. It's an Intellectual Property which they own and have rights over. Advertisements generate a small ad revenue income that helps pay hosting costs. Webmasters are therefore encouraged to deny access to their content to users of AdBlock or Adblock Plus.

AdBlock Banning

How AdBlock banning works
The AdBlock banning script works by detecting the size (in pixels) of the displayed HTML division where ads are intended to be displayed. If the configurable prescribed contents of that division are NOT displayed in the browser (hence the Adblock being used), the user is then denied access to a portion of, or the entire webpage, and redirected to a notification (see screenshot above). In the following configurations you may choose AdBlocker Ban with logging, or without logging.

AdBlock blocker (without loging)

Instructions
1. The first thing is to call in jQuery in the HEAD of your page (included in ZIP download, below):

<head>
<script type="text/javascript" src="jquery-1.10.2.min.js"></script>
</head>


2. Next, create a division Class in the body of your page surrounding the ad script. If you use Google Adsense, your coding should look something like this:

<div class="Google">
<script type="text/javascript">
google_ad_client ...
</script>
</div>


3. Next insert the blocking script anywhere in the page body, preferrably in the footer area, before the closing Body tag:

<script type="text/javascript">
if ($('.Google').height() == 0)
window.location = "adblock-banned.html";
</script>


4. Create a Notification page called adblock-banned.html . This will be the notification page the user gets redirected to.

Upload your files to your server and test it out first WITHOUT using ABlock enabled. You should still see your ads. Then ENABLE your AdBlock and refresh the page. You should now get redirected to the Notification page.

Download this ZIP file Block Adblock Users ZIP
contact us to report broken links


Add Comment

Visitor Comments (6)

Topic: How to Block Adblock Users
Full StarFull StarFull StarFull StarFull Star 5/5 (5)
Facebookdel.icio.usStumbleUponDiggTechnoratiGoogle+RedditMySpaceTwitterLinkedIn
Full StarFull StarFull StarFull StarFull Star
Adam says...
Thank you for the script. Using it now and with additional add ons to load content dynamically as counter measure to NoScript/JS blocker.

Do test out how your page looks like with "Fetch As Google Bot" in Web Master Tools . This is to make sure that you don't accidentally damage your own page's SEO.
2nd September 2015 8:27am
Full StarFull StarFull StarFull StarFull Star
Arthur Arkwright says...
Thanks. I love the script. Easy to deploy and customize.
28th August 2015 3:27am
Full StarFull StarFull StarFull StarFull Star
Another webmaster says...
Works perfectly. Now we can block free-loaders. I modified the script a bit, and rather than blocking them, we redirect them to Disney.com LOL
15th February 2014 4:41am
Full StarFull StarFull StarFull StarFull Star
Don says...
Most adblock filters will detect this.
Most filters will easily detect this.
I've found a solution.
Can't post it here though.
Stupid security detects too many repeating characters :/.
Probably something you guys should look into.
5th January 2014 7:29am
Tom C. says...
Thanks bro. I just found a solution and fixed it Grin
9th January 2014 10:15pm
Page 1 of 1
Norton SafeWeb   Creative Commons License   search button