• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
seegatesite header

Seegatesite.com

Seegatesite.com - Programming Tutorial , Sharing , How and Learn Together

  • TOOLS
    • Bootstrap Navbar Online Generator
    • Customize Sidebar Menu Bootstrap 3
    • Bootstrap Demo
  • ADVERTISE
  • CATEGORIES
    • Android
    • Blogging Tips
    • Database
    • CSS
    • Info Gadget
    • Javascript
    • Linux
    • PHP
    • Various
    • WordPress
  • Q&A
  • PHP
  • JAVASCRIPT
  • JQUERY
  • ANGULAR
  • WORDPRESS
  • SEO
  • REACT
🏠 » Javascript » How Do I Force The Visitor To Turn Off Adblock Extention

How Do I Force The Visitor To Turn Off Adblock Extention

By Sigit Prasetya Nugroho ∙ October 7, 2016 ∙ Javascript, Wordpress ∙ Leave a Comment

Share : TwitterFacebookTelegramWhatsapp

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

1
<script src="//cdnjs.cloudflare.com/ajax/libs/fuckadblock/3.2.1/fuckadblock.js" ></script>

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

Related Articles :

  • Adept Using Datatables Plugin In 10 Minutes For Beginners (Tutorial)
  • How To Use JQuery Input File / Upload File Change Event
  • An Easy Way To Remove Attribute In HTML Element Using JQuery

Okay, let’s start the following tutorial

Table of Contents

  • 1 How to force visitors to disable their Adblock addon on browser before download content
    • 1.1 Thus article about How Do I Force The Visitor To Turn Off Adblock Extention, hope useful 🙂

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

[php highlight=”14″]
<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”

1
<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

1

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 🙂

Another Javascript Related Post :

  • React-Table Not Updating or Refreshing Data, The Solution ?
  • How To Custom React Datepicker In Bootstrap
  • Tutorial Create Simple POS Using ReactJS And Laravel Lumen Part 1
  • Adept Using Datatables Plugin In 10 Minutes For Beginners (Tutorial)
  • The Using Of Reactstrap And React-Table, Suitable For Beginners
  • Tutorial Create Simple Block UI Using React JS

Avatar for Sigit Prasetya Nugroho

About Sigit Prasetya Nugroho

This site is a personal Blog of Sigit Prasetya Nugroho, a Desktop developer and freelance web developer working in PHP, MySQL, WordPress.

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Welcome to my Home,

Avatar for Sigit Prasetya NugrohoThis site is a personal Blog of Sigit Prasetya Nugroho, a Desktop developer and freelance web developer working in PHP, MySQL, WordPress.



Popular Articles

Checked checkbox AdminLTE Bootstrap in Jquery

November 4, 2014 By Sigit Prasetya Nugroho 7 Comments

Simple create date format validation with jqueryUI

December 21, 2014 By Sigit Prasetya Nugroho Leave a Comment

Create Simple Progress Bar for Fake Online Generator with Jquery

January 10, 2015 By Sigit Prasetya Nugroho Leave a Comment

22+ Coolest Free Jquery Plugin For Premium Theme

October 3, 2015 By Sigit Prasetya Nugroho Leave a Comment

Easy Build Your Anti Copy Paste Plugin

October 6, 2015 By Sigit Prasetya Nugroho Leave a Comment

Popular Tags

adminlte (15) adsense (13) adsense tips (4) affiliate amazon (13) amazon (12) Android (8) angular (16) angular 4 (12) angular 5 (4) asin grabber (3) Bootstrap (27) codeigniter (5) create wordpress theme (5) crud (8) css (6) free wordpress theme (7) google adsense (4) imacros (4) increase traffic (6) jquery (34) laravel (10) laravel 5 (5) learn android (5) lumen api (4) modal dialog (5) mysql (6) nodeJs (4) optimize seo (4) pdo (6) php (30) plugin (53) pos (8) Publisher Tips (5) react (6) Reactjs (9) SEO (37) theme (17) tutorial angular (5) tutorial angular 4 (6) tutorial javascript (10) tutorial javascript beginners (4) twitter (3) wordpress (18) wordpress plugin (13) XMLRPC (5)




  • About
  • Contact Us
  • Disclaimer
  • Privacy Policy
  • Terms and Conditions

©2022 Seegatesite.com