How Do I Force The Visitor To Turn Off Adblock Extention

Forcing visitors to turn off Adblock Extension? Why not. This way I did on my several blog download. The debate about Adblock indeed confusing, and I’m sure many of us are still using Adblock addon on their browser. Adblock is indeed very helpful if we open some sites whose contents is full of pop-up ads, some blogs are just chasing the money, they put pop up ads very outrageous. But what about us who put AdSense ads and comply with applicable rules? Of course, our income dropped drastically. Here’s how I force visitors to disable Adblock extension.

I use the javascript plugin called FuckAdBlock as the main core anti-adblocker code. FuckAdBlock is going pretty well on some browsers that I’ve tried. Indeed, the name of this plugin is not pleasant to hear, but its performance is quite good to eliminate adblocker addon. My code is workflow eliminates the download button if the visitor uses adblocker addon on them and warned them to turn off the AdBlock extension before download.

What is needed so that the script is going well?

  1. FuckAdBlock Plugin, please download here or using the following CDN
<script src="//cdnjs.cloudflare.com/ajax/libs/fuckadblock/3.2.1/fuckadblock.js" ></script>

2. Jquery, I use jquery to execute the script.

Okay, let’s start the following tutorial

How to force visitors to disable their Adblock addon on browser before download content

Create an HTML file with the name testadblocker.html and copy the following code

<html>
<head>
<title>Anti addblocker hide button</title>
<link id="cssku" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" >
</head>
<body>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
		tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
		quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
		consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
		cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
		proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

<div class="checkadblock" style="margin:30px;"><button class="buttondl" style="display:none">Download here</button></div>

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
		tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
		quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
		consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
		cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
		proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

<script src="https://code.jquery.com/jquery-2.2.4.min.js" ></script>
 <script src="//cdnjs.cloudflare.com/ajax/libs/fuckadblock/3.2.1/fuckadblock.js" ></script>
<script>
 function adBlockDetected() {
 //$("#cssku").remove();
 $(".checkadblock").html("<h3><center>Please disable your adblock plugin and refresh browser to show download button</center></h3>");
 }
 function adBlockNotDetected() {
 $(".buttondl").css("display", "");
 }

 if(typeof fuckAdBlock === 'undefined') {
 adBlockDetected();
 } else {
 fuckAdBlock.setOption({ debug: true });
 fuckAdBlock.onDetected(adBlockDetected).onNotDetected(adBlockNotDetected);
 }

 </script>
</body>
</html>

Please test on your browser, and the results are as shown below
Force Visitors To Disabled Adblock

In addition to the download button, we can remove the css file in order to see our blog mess. Do the following:

1. Add the ID attribute in the link css element. for example, I added id = “cssku”

<link id="cssku" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" >

2. Change adBlockDetected function () to be as follows

function adBlockDetected() {
$(“#cssku”).remove();
}

Please test your browser and see the results ??

What if we implement on WordPress? I will discuss on other occasions

Another anti-Adblock article : Easy Way Install Anti Adblock Plugin for WordPress and Blogger

Thus article about How Do I Force The Visitor To Turn Off Adblock Extention, hope useful 🙂

The following two tabs change content below.
This site is a personal Blog of Sigit Prasetya Nugroho, a Desktop developer and freelance web developer working in PHP, MySQL, WordPress.

Leave a Comment

Your email address will not be published.

Time limit is exhausted. Please reload CAPTCHA.

%d bloggers like this: