This is a text field
This is a text field
This is a text field
This is a text field

How To Disable Adblock On Your Website Easily

So, you have ads on your website or blog and you have put up ads to help fund the website and you want to make the most of your ads? If so, read on. Many people user adblocking software within their web browsers to block ads. With the help of some javascript tweaking, you can deny them access to your site. This will work for both AdBlock and AdBlock Plus.

Step 1.

First you need to create advertisement.js file on your hosting server where your website is, in the root directory. Adblocking software will be triggered by it due to the name, so do not change the name. Then one you have done this, add this code into the file:

document.write('<div id="tester">an advertisement</div>');

Now add this code right <body> tag:

<script type="text/javascript" src="/advertisement.js"></script>

<script type="text/javascript">
if (document.getElementById("tester") == undefined){
    window.location = "http://yourlandingpage/adblock.html";


With this code added your visitors will be redirected to your landing page where it will ask them to disable adblocking software to see your webpage. This code can be added in and edited later.

Lastely you have to add this code into your CSS file or into the <style></style> tags in the in head of your HTML:

#tester {

So now you have adblock on your site. If you do not wish to send them to your landing page you can tell them with a popup instead by removing this code:

window.location = "http://yourlandingpage/adblock.html";

Replace it with:

window.alert(“Your pop up warning!”);


And if you wish to add in a paragrapgh or short message use this code:

document.write(‘Your paragraph warning!’);