The use of adblockers is gradually gaining a lot of ground and with the latest version of Opera and Opera mini browsers shipping with adblockers, its use is bound to take a jump.

First of all, what is an adblocker?

These are pieces of code that can be installed into a browser as browser extensions or plugins and are able to stop websites from showing ads in the browsers. Typically, they prevent the site from loading external Javascript files responsible for the display of ads to block ads from displaying. Adblockers came into being because users got tired of websites that advertise to them aggressively and put ads that stand too much in their faces, obstruct them from seeing the content that they came to the website to read/watch/listen to in the first place. Furthermore, remarketing Javascript codes that make sure you continue to see an ad on every site that you go to just because you showed a little bit of interest in the advertiser by visiting their site took the whole thing to another level. This made some people come up with adblockers.

How does it impact bloggers and other publishers?

Lots of bloggers and content publishers offer creative content for free in order to draw traffic and then they try to monetize their content by showing display ads so that they can make money and earn a living. In essence, they offer value on their blogs to readers and make money back by running adverts on their site either through an adnetwork like Google Adsense and co or direct adverts for other corporate organisations and individuals.

However, the advent of adblockers (which has been around for sometime anyway) is threatening that monetization model and the latest Opera and Opera mini browser release has now underscored that fact further. A very large percentage of Nigerian web users access the web on their mobile devices and in a bid to reduce the amount they spend on data and/or to increase their browsing speed, a very large chunk of those mobile users actually access the web using Opera mini browser. From time, ads don’t display properly or not at all on this particular browser, and now that adblocker has now being implemented in its latest version, what it implies is that less and less people would see the display ads running on lots of sites. Therefore, it would drive the revenue of these sites down and would threaten the profitability or existence of these sites.

So, as bloggers, how do we deal with this?

Dedicated Servers from Liquid Web

Apart from showing display ads, bloggers should start thinking of other monetization means. However, we can’t just give up on the fight like that, which brings us to how we can detect these adblockers when visitors visit our websites. The action that is taken when an adblocker is detected in a user’s browser may vary depending on what the owner of the site wants. You can

  • display a message as a text or image telling the visitor to disable the adblocker as they help your “ministry” when ads are not blocked
  • turn your content to paid content so that only those that pay you a certain amount of money would be able to access your content and so you won’t have to display on running advertisements for your site to survive. This would only work for those that are already well-known though.
  • take the very aggressive approach of hiding your content when adblockers are detected, which means you are saying that “if you don’t allow my ads to be displayed to you, then I’m not allowing my content to be displayed to you as well”.

Well, the action to be taken when they are detected depends on the owner of the website. However, let’s see how to detect them first.

How to detect adblockers?

Since display ads are generally implemented by loading a file containing some Javascript code into the user’s browser and what the adblocker does is to stop such Javascript code from being loaded, then method 1 capitalizes on that.


  1. Create a file named adframe.js
  2. Put this code in the file
    var ads_are_blocked = false;
  3. Upload the file to the root directory of your site.
  4. Now insert the following code into every page where you want to detect adblockers. There’s usually a file that is included in every page like your header.php or so, so the code should be inserted into such files.
    <script type="text/javascript">
    var ads_are_blocked = true;
    <script type="text/javascript" src="adframe.js"></script>
    <script type="text/javascript">
    if(ads_are_blocked) {
    //adblocker is installed, so take any action that you want to take

Once an adblocker is installed, then the code to take any action that you wish to take can be inserted in the if block of the code.


  1. Insert the code below into every code on which you want to detect adblockers.
    var test_div = document.createElement('div');
    test_div.innerHTML = '&nbsp;';
    test_div.className = 'adsbox';
    window.setTimeout(function() {
    if (test_div.offsetHeight === 0) {
    //adblocker is installed, so take any action that you want to take
    }, 100);
  2. Put in the code to carry out any action that you want when an adblocker is installed in the if block in the code above.

Both methods 1 and 2 would do the work. However, method 2 has the advantage of not loading any extra Javascript file, which would consequently not increase the load speed of the page as against method 1.

You may also like

10 Ways To Get More Nigerian Followers on Instagra... Instagram is the next big thing after Twitter and Facebook. For Nigerians, it's a way to connect, reach out or even for business. But to explore Insta...
5 Things to Check before Installing An App From Th... For most people, downloading from the Playstore is the easiest task and thus, people hardly think they need to take some steps or do certain things to...
The Top 5 Web Hosting Companies and Domain Registr... The importance of a good domain name in Nigeria cannot be understated in the blogging world. A good domain name can make or break a blogger. Thus, the...
7 Ways to Curb Phone Addiction Like dogs to bones many of us are stuck on our phones and we are not to be blamed. Mobile phones have replaced many devices in our modern lives in a p...
10 tips to get more Facebook likes for your Busine... If you run a Facebook page for your business, then you will probably know how important it is having more likes on your page. If you follow these 10 t...
5 Smart Methods To Maintain Site Visitors On Your ... Hi, perhaps you are reading this right now and you are a webmaster or a blogger and you have been finding it rather difficult to maintain Your Website...
Subscribe to our post updates

Subscribe to our post updates

Join our mailing list to receive the latest updates on mobile phones, computers, blogging, tips & tricks, how to's, tech news and special offers from us.

Please, click the link in the mail that we just sent to you to confirm your subscription. Thank you.

Pin It on Pinterest