Title: This doesn&#039;t work with AdBlockPlus
Last modified: August 22, 2016

---

# This doesn't work with AdBlockPlus

 *  Resolved [Rick Mac gillis](https://wordpress.org/support/users/cozylife/)
 * (@cozylife)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/this-doesnt-work-with-adblockplus/)
 * As AdBlockPlus doesn’t remove the div, but instead hides the img code, this plugin
   no longer works with AdBlockPlus if it ever did. I’ve tried giving ABP a clear
   indication that an ad was present by creating a div with an id of “banner,” “
   ad,” or “ads” and it never kills the div.
 * [https://wordpress.org/plugins/ad-blocking-detector/](https://wordpress.org/plugins/ad-blocking-detector/)
 * UPDATE: Now I get it. It isn’t hiding the image, but instead it blocks the request
   to the URL causing the image to appear as invalid.

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [John Morris](https://wordpress.org/support/users/jtmorris/)
 * (@jtmorris)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/this-doesnt-work-with-adblockplus/#post-5271437)
 * Hello,
 * From the information you provided, I am unsure what problem you are having. I
   just verified this plugin works using the official, widely used AdBlock Plus 
   add-on/extension in Chrome and Firefox. If the plugin isn’t working can you please
   let me know what browser, what operating system, and exactly what ad blocker 
   you are using (perhaps a link to the listing from the browser’s web store/directory).
   Lots of extensions have similar names and logos to try and capitalize on the 
   original AdBlock Plus’s popularity, so sometimes the name isn’t enough.
 * ————————
 * Without more information, based on your post I can only guess there is a misunderstanding
   as to how this plugin works, so allow me to elaborate.
 * Most ad blockers work by preventing content on their block lists, and content
   that is obviously an advertisement, from loading at all. Others by simply hiding
   the ad so the end-user can’t see it.
 * Due to variety of ways ad blockers accomplish their task, and the variety of 
   potential content site administrators use that might be blocked, this plugin 
   looks to see whether pre-determined content is blocked and uses that as it’s 
   sole criteria for detecting ad blockers. It inserts into the page, or attempts
   to load, juicy content that most ad blockers will flag. At the moment, it uses
   3 items.
    1. First, an iframe element pointing to a fake URL loaded with keywords ad blockers
       hate (e.g ‘advertisement’).
    2. Second, a <div> with similar keywords in class and ID attributes, and within
       the <div> itself.
    3. Third, a JavaScript file with a name that, again, sets off alarm bells for the
       ad blockers.
 * If any of these 3 items are prevented from loading or are hidden or obscured,
   the plugin acts as if an ad blocker exists. If all 3 items are present and seemingly
   unmodified, it acts as if no ad blocker exists. Based on that information, the
   plugin determines which content to show (the _ad block detected_ content, or 
   the _no ad block detected_ content).
 * The plugin does not rely on any content provided when creating an Ad Blocking
   Detector shortcode for detection, and should be immune to subtleties like ad 
   blockers blocking images instead of divs because it uses strategically created
   bait items to do its job.
 * Which of these methods works depends on the ad blocker. By far the most effective
   is the JavaScript file. Every ad blocker I’ve tested with blocks the JavaScript
   file. But most also block one or more of the others.
 * For easier debugging, the plugin outputs a report to the JavaScript console in
   your web browser. Here is a sample report from the AdBlock Plus Chrome extension.
   AdBlock plus blocks the iframe and JavaScript file. Therefore, the plugin displays
   the _ad block detected_ content.
 *     ```
       ABD Detector:: iframe removal detected! (Detection Method: iframe css changed to hidden - frame.css('visibility') === 'hidden' || frame.css('display') === 'none')
       ABD Detector:: No div removal detected
       ABD Detector:: js removal detected! (Detection Method: Bait javascript file prevented from loading and execution!)
       ```
   
 * If you want to see it yourself, visit [the plugin’s demo page](http://adblockingdetector.jtmorris.net/demo/)
   and view your JavaScript console (sometimes called “web console,” “console,” 
   or “developer console” depending on the browser).
 * —————————–
 * I hope this has helped, and let me know the details requested at the beginning
   of this post (and any others you think of that are relevant) if not.
 *  Thread Starter [Rick Mac gillis](https://wordpress.org/support/users/cozylife/)
 * (@cozylife)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/this-doesnt-work-with-adblockplus/#post-5271440)
 * Thanks for the info. Your demo is working in my current setup, but for some reason
   it doesn’t work on my site.
 * Domain: rickmacgillis.com (Check the homepage on the right sidebar under the “
   Who’s Online” box. Nothing shows when ABP is on and it shows ads when ABP is 
   off.)
 * Browser: FireFox 32
    ABP: [https://addons.mozilla.org/en-US/firefox/addon/adblock-plus/](https://addons.mozilla.org/en-US/firefox/addon/adblock-plus/)
   OS: Windows 8.1 (I seriously doubt that it matters.)
 * I have FireBug and my console says that it didn’t detect any changes.
 * If you don’t know of anything causing this by tomorrow, I’ll start disabling 
   plugins and see what happens. Do you know of any compatibility issues with other
   plugins, such as W3 Total Cache and Autoptimise? As this works through JS and
   I can clearly see the code is correctly displaying, it might not be a compatibility
   issue.
 *  [John Morris](https://wordpress.org/support/users/jtmorris/)
 * (@jtmorris)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/this-doesnt-work-with-adblockplus/#post-5271510)
 * It looks like the Autoptimize plugin is messing with the JavaScript file detection
   method. Optimization plugins are notorious for interfering with JavaScript. It
   seems Autoptimize combines JavaScript files together into one file to reduce 
   load time. As this would be done server side, before the browser is involved,
   the net result is the bait JavaScript file no longer exists as far as the browser’s
   ad blocker is concerned.
 * Since the only detected ad removal method for AdBlock Plus in Firefox, at the
   moment, is the JavaScript file, this causes it to break.
 * An immediate fix is to exclude the JavaScript file in Autoptimize. If you show
   advanced settings in Autoptimize and add “advertisement.js” to the list of excluded
   files under JavaScript Options, I believe it will work again (it does on my testing
   site).
 * I’ll look into AdBlock Plus in Firefox to see if I can get the other detection
   methods working again. When first written, the iframe and div were both removed
   and detected in AdBlock Plus. But, the developers are making their add-ons more
   difficult to detect.
 *  Thread Starter [Rick Mac gillis](https://wordpress.org/support/users/cozylife/)
 * (@cozylife)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/this-doesnt-work-with-adblockplus/#post-5271518)
 * You’re right. Nice work. For anyone else having this issue, enable the try/catch
   and add the following to the end of your script exclusions.
 * `,advertisement,jquery,adblock-detector`
 * If you’re not using JQuery, then just ignore that part. I’m going to write a 
   5 star review now. Thanks for your help!
 *  [John Morris](https://wordpress.org/support/users/jtmorris/)
 * (@jtmorris)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/this-doesnt-work-with-adblockplus/#post-5271530)
 * Thanks for the review, and I’m glad it worked out!
 * Let me know if you encounter any other problems.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘This doesn't work with AdBlockPlus’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/ad-blocking-detector_466992.svg)
 * [Ad Blocking Detector](https://wordpress.org/plugins/ad-blocking-detector/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ad-blocking-detector/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ad-blocking-detector/)
 * [Active Topics](https://wordpress.org/support/plugin/ad-blocking-detector/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ad-blocking-detector/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ad-blocking-detector/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [John Morris](https://wordpress.org/support/users/jtmorris/)
 * Last activity: [11 years, 9 months ago](https://wordpress.org/support/topic/this-doesnt-work-with-adblockplus/#post-5271530)
 * Status: resolved