What's WP
Find Everything Related to WordPress - Best Tutoriasl on WordPress!
How to Detect AdBlock Users in WordPress

How to Detect AdBlock Users in WordPress

AdBlock is a web browser extension that blocks ads, especially the hidden popup ads, from displaying. It makes sure a good user experience, but many bloggers who rely much/solely on ad services to make money from blogging have suffered a lot from a loss of revenue potential.

If you are such a blogger, it’s probable that you are searching for a way to detect who are blocking your ads so that you can take some measures to retrieve some changes for bringing in income. The good news is that there are many plugins which can help you detect AdBlock users in WordPress.

So for today, we’d like to introduce a plugin named Ad Blocking Detector. Later, we will show you how to use the plugin for detection, and offer some suggestions about how to deal with those AdBlock users.

Detect AdBlock Users in WordPress with Ad Blocking Detector

As the name suggests, Ad Blocking Detector is built for detecting those browser extensions, plugins and add-ons with an ad blocker feature. The good things of this plugin are:

  • It detects all the major ad blocking extensions for all the major web browsers.
  • It is compatible with WordPress multisite installs.
  • Developers can combine JavaScript and CSS with the plugin to display anything they want for AdBlock users.

Ad Blocking Detector Plugin

After installing and activating the plugin, an Ad Blocking menu item will be added to the WordPress dashboard. To get the plugin working, there are only two steps needed, which are explained in below.

But before taking any of the following steps, there is one more thing to do – going back to the plugin list and activating the “Ad Blocking Detector – Block List Countermeasure Plugin” which is installed automatically during the installation of Ad Blocking Detector. This is a must to make sure the functionality of the ad blocking detection feature since the core files of the original plugin can be easily blocked by ad blockers.

If you cannot find the Block List Countermeasure Plugin in your plugin list, you can click on the Ad Blocking menu item, open the Advanced Settings tab, and hit the “Automatically Install Plugin” button below the status list.

Automatically Install Block List Countermeasure Plugin

Step 1: Create a Shortcode

In the dashboard of the plugin, there are several tabs available. What you need to do now is to create a new shortcode by clicking on the Add New Shortcode tab.

Add New Shortcode

On the editing page, you have to deal with the following fields.

  • Name: Give a name to the shortcode or add a short description.
  • No Ad Blocker Detected Content: What you enter in this text field will be displayed to visitors when no ad blocking software is detected. You can put your ads here, add some texts, add HTML, or just leave it empty. If you want to test how it functions, you can put a line of simple text in it.
  • Ad Blocker Detected Content: What added in this text box is shown to those visitors who have installed ad blocking software. If you don’t add anything custom, there is still a default message which tells that an ad blocker is detected. However, we’d suggest you tailor a message or image to kindly ask the visitors to whitelist your site or require them to take other actions.
  • Custom Wrapper CSS Selector: Here you can specify the wrapping element of your ads. If you want to detect Ghostery, you will need to deal with this section, but for most ad blockers like AdBlock Plus, you can leave the text field empty.

Edit the Shortcode

At last, save the configurations by clicking on the “Save Changes” button.

Step 2: Add the Shortcode to your site

Now that the shortcode is created successfully, it’s time to add it to your WordPress site to make it function. Luckily, this is an easy job because Ad Blocking Detector includes a built-in widget which simplifies the work.

Clicking on Appearance > Widgets, you can see a widget named Ad Blocking Detector is available in the widget list.

Ad Blocking Detector Widget

Just drag the widget to the sidebar or footer of your site, and then select a shortcode to display. That’s all.

Configure the Widget

Besides the use of the widget, you can also manually insert the shortcode into your website. To do this, you have to open the Manage Shortcodes tab in the plugin dashboard, find the shortcode created before, and click on the green “Get This Shortcode” button.

Get This Shortcode

On the little popup box, copy the shortcode.

Copy the Shortcode

As long as ad blocking detection is enabled, you can visit your website to have a test. To make sure everything works fine, you may need to install the AdBlock Plus extension to see whether the detector displays messages in the way you want.

How to Deal with AdBlock Users?

There are several actions you can take toward those visitors who block your ads from showing. Some of them are listed in below, while you should know the decision is completely yours.

  • Do nothing. Being ad-free delivers a better user experience. Also, some AdBlock users may still contribute to your website by leaving comments or sharing your content on social networks. If you don’t want to lose those users’ value, you can certainly do nothing. This is not a bad option if the ad revenue is not your major income source.
  • Take a passive approach. For this solution, you can ask the AdBlock users to whilelist your site, or ask them to pay for an ad-free browsing experience, for example, making a small donation or taking part in a membership with a small fee.
  • Block your site from AdBlock users. In this case, those users must turn off AdBlock before they can visit your site. However, this approach is least recommended because it is too aggressive and can turn a large number of visitors away.


Joyce is a professional writer & SEOer who loves trying new things and sharing the experience through blogging. She loves clean design, playing with different WordPress themes, SEO, etc. Very often, you could find her in various WordPress event as invited speakers.