How to Limit Comment Length in WordPress
May 18, 2015
8 Best New and Fresh Real Estate WordPress Themes September 2015
October 15, 2015

How to Detect AdBlock Users in WordPress

Are you looking for a way to detect AdBlock users in WordPress? Many bloggers rely on ad revenues to support their websites. Browser extensions like AdBlock plus can hurt your revenue potential. We will show you how to detect AdBlock users in WordPress and show them a custom message asking them to support your site in this article.

Detect AdBlock Users in WordPress

What is AdBlock and How does it hurt you?

Users are allowed to disable ads on your WordPress site by AdBlock is a simple but effective add-on for web browsers.

It can hurt bloggers who rely solely on ad revenues while Adblock brings a cherished ad-free experience to users.

There are few approaches that you can take to deal with AdBlock. Each has their pros and cons.

The Do-Nothing Approach

As the title says, you do nothing about the users with AdBlock. You simply learn to live with the loss of revenue for the sake of happy users.

Passive Approach

In a passive approach,you can ask them to join a premium membership or make a donation to support your efforts while browsing ad-free, you can encourage users to whitelist your site to display ads. Alternatively.

This is something a very popular site like Reddit does. They offer their users an ad-free experience for a small monthly fee. You can do this by adding a text link to your site below your ads saying want an ad-free experience? If the user clicks on that, they will be taken to a page where you can explain the details. See Reddit Gold pagefor example.

Aggressive Approach

In this approach, you simply block the site for all users with AdBlock enabled.They must disable AdBlock if they want to view your content.

This kind of approach is rather aggressive and will turn away users from your site. It’s best to use the passive approach that we mentioned above.

Now that you know of the various approaches to dealing with AdBlock users, let’s look at how we can do this.

How to Detect AdBlock in WordPress

First thing you need to do is install and activate the Ad Blocking Detector plugin. The plugin will add a new menu item labeled ‘Ad Blocking’ to your WordPress admin upon activation. You need to click on it to configure the plugin’s settings.

Settings page for Ad Blocking Detector plugin

You can either edit the Sample Shortcode or create your own shortcode. For the sake of this example, we will edit the existing shortcode.

AdBlock Detector WordPress Edit Shortcode Page

You will see a name field for the shortcode on the edit screen,. Below that you will notice two text areas. The first one will be displayed when no Adblocker is found on user’s browser.

For testing purposes, we recommend that you to add something short here like ‘No Ad Blocker detected’. Later you can put your ads here or leave this box completely empty.

The next box is displayed when the plugin detects that a user has Ad blocking software installed. The default message only shows that the plugin has successfully detected adblock. You can change that with your own custom message.

The WordPress AdBlocking detector plugin comes with basic auto-styling enabled for both text areas. If this auto-styling conflicts with your theme, then you can disable auto-styling under Content Auto-Styling section. Simply check the box next to ‘No. Disable it”.

Disable auto styling

You need to click on the save shortcode button to save your settings.

Now that you have created a shortcode, it’s time to add it.

This plugin comes with a built-in widget that you can add. Simply head over toAppearance » Widgets and drag / drop the Ad Blocking Detector widget to a sidebar.

Ad Blocking Detector Widget

Provide the widget a title if you want, and then select the shortcode from the drop down menu. Lastly, don’t forget to save your widget settings.

That’s all you can now preview your site. If you do not have AdBlock installed, then you will see the message or ad that you entered in no AdBlock box for the shortcode.

Users with no ad blocker

To see the AdBlock message, you will need to install Adblock Plus and then test your website. For the shortcode you will see the notice that you entered in the AdBlock detected box .

Users with ad blocker installed will see your message

The WordPress AdBlock detector plugin detects all major ad blocking browser extensions on all major web browsers including AdBlock Plus. It is also fully compatible with WordPress multisite networks.

John Morris, the author of this plugin, has written a detailed tutorial on how to extend this plugin further with JavaScript to do things like block the entire site access, show a popup with a custom message, add angry gifs, etc.

Welcome to Wordpress Mind! We aim to be a source of quality information free WordPress themes for WordPress lovers all around the world.

Leave a Reply

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

CAPTCHA HERE * Time limit is exhausted. Please reload the CAPTCHA.