How to Add AdBlock Killer Script For Blogger?

What is Adblocker?

Adblock is an attachment on a browser or application to terminate advertisements on a site; we understand that ads on the blog occasionally annoy visitors. Consequently, internet users start using the Adblock extension.

What is Anti - Adblock Script?

As Adblocker Blocks ads, Anti- Adblocker causes users to remove Adblock to access the site forcibly; by Using this, users can't access your location by enabling Adblock.

Why use Anti- Adblock Script?

If users see your site with AdBlock, they won't see any ads on-site. If ads are not shown, your AdSense earnings will be down, so you have to use this script to get rid of this. It will perform on every AdBlock browser.

How to add this code to our theme?

Just observe the steps, and it will do all themes so you can use them easily.

In which template the ad-blocker works perfectly

Check templates:

Back up your theme to fix it later if any problem occurs.

How to add this Anti-adblocker to your website

STEPS for adding Code to Blogger website.

  • Go to blogger dashboard
  • Click on the 'theme' section
  • Find </body> in template
  • Please copy the below script code and paste it above the </body>

Step 1

  1. Log in to your Blogger Account
  2. Go To Edit HTML and insert this CSS
  3. or before </head>
<style>
#h237 {
        background-color: #fcfcfc;
        opacity: .99;
        display: table;
        position: fixed!important;
        position: absolute;
        z-index: 9999!important;
        width: 100%;
        height: 100%;
        top: 0;
        top: expression((t=document.documentElement.scrollTop?document.documentElement.scrollTop: document.body.scrollTop)+"px");
        bottom: 0;
        right: 0;
        left: 0;
        padding: 2% 0
    }
    
    #h237 p {
        font-family: 'Open Sans', sans-serif;
        font-size: 20px;
        font-weight: normal;
        color: #7a7a7a;
        line-height: 30px;
        text-decoration: none;
        text-align: center;
        display: table-cell;
        vertical-align: middle;
        margin: 0 auto
    }
    
    #h237 p a {
        background: #ff4e00;
        display: block;
        font-family: 'Open Sans', sans-serif;
        font-weight: 700;
        font-size: 14px;
        color: #fff!important;
        line-height: initial;
        text-align: center;
        text-transform: uppercase;
        letter-spacing: .5px;
        width: 100px;
        padding: 10px;
        border-radius: 3px;
        margin: 30px auto;
        clear: both;
        transition: all .3s ease-out
    }
    
    #h237 p a:hover {
        background: #00BF59;
        color: #fff
    }
    
    #h237~ * {
        display: none
    }
</style>

Step 2

  1. Insert below code at the end of your theme, i.e. before closing the </body> tag.
<script>
 /*<![CDATA[*/
    window.document.getElementById("h237").parentNode.removeChild(window.document.getElementById("h237"));
    (function(b, a) {
        function e(f) {
            f && h237.nextFunction()
        }
        var c = b.document,
            d = ["i", "s", "u"];
        e.prototype = {
            rand: function(f) {
                return Math.floor(Math.random() * f)
            },
            getElementBy: function(g, f) {
                return g ? c.getElementById(g) : c.getElementsByTagName(f)
            },
            getStyle: function(g) {
                var f = c.defaultView;
                return f && f.getComputedStyle ? f.getComputedStyle(g, null) : g.currentStyle
            },
            deferExecution: function(f) {
                setTimeout(f, 250)
            },
            insert: function(i, h) {
                var n = c.createElement("span"),
                    o = c.body,
                    p = o.childNodes.length,
                    l = o.style,
                    m = 0,
                    j = 0;
                if ("h237" == h) {
                    n.setAttribute("id", h);
                    l.margin = l.padding = 0;
                    l.height = "100%";
                    for (p = this.rand(p); m < p; m++) {
                        1 == o.childNodes[m].nodeType && (j = Math.max(j, parseFloat(this.getStyle(o.childNodes[m]).zIndex) || 0))
                    }
                    j && (n.style.zIndex = j + 1);
                    p++
                }
                n.innerHTML = i;
                o.insertBefore(n, o.childNodes[p - 1])
            },
            displayMessage: function(g) {
                var f = this;
                g = "abisuq".charAt(f.rand(5));
                f.insert('<p>We are glad you stopped by!<br/><br/><img border="0" src="https://lh3.googleusercontent.com/-L0N72E8E9NQ/Vzrq-aAsrLI/AAAAAAAAENQ/4t2LPjMDYGQIejFrOFVIqJYUpzCDeI5uACCo/I/Disable-Adblock.png" /><br/><br/>But please understand that without advertising this website would not be here.<br/><br/>We serve responsible ads and ask that you disable your ad blocker while visiting<a href="JavaScript:window.location.reload()">RELOAD</a></p>', "h237");
                c.addEventListener && f.deferExecution(function() {
                    f.getElementBy("h237").addEventListener("DOMNodeRemoved", function() {
                        f.displayMessage()
                    }, !1)
                })
            },
            i: function() {
                for (var h = "DivTopAd,ad-zone-1,ad_190x90,ads-sticky,iqadtile5,leftframeAD,tobsideAd,ad,ads,adsense".split(","), f = h.length, j = "", k = this, l = 0, i = "abisuq".charAt(k.rand(5)); l < f; l++) {
                    k.getElementBy(h[l]) || (j += "<" + i + ' id="' + h[l] + '"></' + i + ">")
                }
                k.insert(j);
                k.deferExecution(function() {
                    for (l = 0; l < f; l++) {
                        if (null == k.getElementBy(h[l]).offsetParent || "none" == k.getStyle(k.getElementBy(h[l])).display) {
                            return k.displayMessage("#" + h[l] + "(" + l + ")")
                        }
                    }
                    k.nextFunction()
                })
            },
            s: function() {
                var i = {
                        "pagead2.googlesyndic": "google_ad_client",
                        "js.adscale.de/getads": "adscale_slot_id",
                        "get.mirando.de/miran": "adPlaceId"
                    },
                    h = this,
                    n = h.getElementBy(0, "script"),
                    o = n.length - 1,
                    p, l, m, j;
                c.write = null;
                for (c.writeln = null; 0 <= o; --o) {
                    if (p = n[o].src.substr(7, 20), i[p] !== a) {
                        m = c.createElement("script");
                        m.type = "text/javascript";
                        m.src = n[o].src;
                        l = i[p];
                        b[l] = a;
                        m.onload = m.onreadystatechange = function() {
                            j = this;
                            b[l] !== a || j.readyState && "loaded" !== j.readyState && "complete" !== j.readyState || (b[l] = m.onload = m.onreadystatechange = null, n[0].parentNode.removeChild(m))
                        };
                        n[0].parentNode.insertBefore(m, n[0]);
                        h.deferExecution(function() {
                            if (b[l] === a) {
                                return h.displayMessage(m.src)
                            }
                            h.nextFunction()
                        });
                        return
                    }
                }
                h.nextFunction()
            },
            u: function() {
                var g = "ad&adv_keywords=,-page-peel/,/adchain.,/adfootright.,/adsxml/ad,/adyard300.,/impopup/ad,/loadadsparam.,/meme_ad.,_adshare.".split(","),
                    f = this,
                    h = f.getElementBy(0, "img"),
                    i, j;
                h[0] !== a && h[0].src !== a && (i = new Image, i.onload = function() {
                    j = this;
                    j.onload = null;
                    j.onerror = function() {
                        d = null;
                        f.displayMessage(j.src)
                    };
                    j.src = h[0].src + "#" + g.join("")
                }, i.src = h[0].src);
                f.deferExecution(function() {
                    f.nextFunction()
                })
            },
            nextFunction: function() {
                var f = d[0];
                f !== a && (d.shift(), this[f]())
            }
        };
        b.h237 = h237 = new e;
        c.addEventListener ? b.addEventListener("load", e, !1) : b.attachEvent("onload", e)
    })(window); /*]]>*/
</script>

Step 3:

  1. Insert below code at the end of your theme, i.e. after closing of </head> tag.

<div id="h237"> /div>

<div id="h237">
</div>

View Sitemaps

See Also :