many people use WordPress to run a blog or website and monetize it through various ad platforms such as Google AdSense, Dable, and Tenning. However, if some of your visitors are using an **Ad Block extension**, your ads may not be displayed properly, which can directly affect your revenue.

as the percentage of ad block users grows, the decrease in revenuedue to ad blocking can mean a decrease in revenue for those of you who make money from AdSense ads. There are two ways to detect or work around AdSense ad block users to address the decrease in AdSense revenue
- utilize the AdSense Ad Recovery Program
you can use AdSense’s ad block recovery feature to prompt ad blockers to allow ads and encourage them to view your ads again. - utilize ad blocking plugins and scripts
wordPress plugins or your own JavaScript code can also be effective ways to detect ad blockers, display alternative messages, or restrict access to your content.
✅ A word of caution
a word of caution, while ad revenue may increase, your SEO may be impacted by the bounce rate of users requesting to disable ad blockers.
depending on the situation, it is recommended to choose and operate according to whether you mainly use search or external traffic.
in this article, we’ll walk you through two methods you can use to prevent ad blockers from reducing your revenue, step by step.
1. setting up an AdSense Ad Recovery Program
blocking ad blockers with the AdSense Ad Recovery Program
- from the AdSense home page, go to Privacy & Messages > Manage ad block recovery
go to the AdSense homepage and click Privacy & Messages in the AdSense menu.
Scroll down to the bottom and click Manage under the Ad Block Recovery menu. - create an AdSense Ad Block Allow message.
in the ad block recovery prompt, click Messages, and then click Create message.
- proceed with the ad blocking acceptable message settings.
select the ad blocked site in the ad blocking acceptable message settings.
Include and exclude pages, you can set the URLs within the site to include and exclude the ad blocking acceptable message.
The default language is Korean, and you can select one of three placement settings.
choose from centered, centered with no close option , or fixed at the bottom of each of the 3 positions. - styling the ad blocking acceptance message
in the Ad Blocking Allowed Message, in Styling, you can convert the text of the ad message, change the color of the ad message, etc.
To convert the text first, click Styling, then hover your mouse next to the ad message, you can edit the ad blocking message title and body.
You can choose the color of the ad message, as well as the buttons, font size and color, after clicking Header, Title, Body on the right, you can choose the color and size.
After selecting all, click Publish on the top right. - insert the ad blocking allow script code into the header.
once the ad blocking acceptable message has been generated, you need to insert the code on your own site.
The generated ad blocking acceptable message script code can be found in Privacy and Messages – > Tagging -> Copy.
Once copied, enter the code between <header> and </header> on your own site.
2.using an ad block detection plugin
using a plugin that provides ad block detection in WordPress is a simple setup. with an ad block plugin, you can display alternative content for ad-blocked users or hide your content. there are three plugins used in WordPress to detect ad blocking, listed below.
adblock Detection Plugin 1 – Admiral Adblock Analytics

- features
- detects ad blocking software and displays a notification window asking the user to unblockthe ad blocker.
- provides data to analyze the percentage of ad block usage and its impact on your site.
- simple setup and quick to apply on your WordPress site.
- how it works
- display an ad block disable message.
- Analyze ad block usage rates to manage lost ad revenue.
- download the plugin
ad Blocking Plugin 2 – CHP Ads Block Detector

- features
- providesmore advanced functionality, including the ability to detect and bypass ad blocks.
- provide alternative content or restrict access after detecting ad block users.
- optimize user experience with customized messages and designs.
- how it works
- Target Ad Block users with a message asking them to unblock ads.
- prevent ad block users from viewing content with content blocking features.More
- provides Ad Block detection and bypass with advanced features.
- download the plugin
how to install the Ad Block Detection plugin
- install the plugin from
- in your WordPress admin page, go to [Plugins] -> [Add New].
- search for the plugin name above and click the [Install] -> [Activate ] button.
- setting up the plugin
- on the plugin settings page, set the following options
- show notification message: “You are using an ad blocker. please disable your ad blocker for a smooth experience on our site.”
- content blocking: Hide or block some content when an ad blocker is detected.
- custom message: Customize the notification pane with a design and wording that fits your site.
- on the plugin settings page, set the following options
- test
- Visit your site in a browser with Ad Block enabled to make sure the plugin is working properly.
adding ad blocker detection code directly: Installing the plugin ❌
withoutthe WordPress Ad Block Detection plugin, you can also add JavaScriptcode directly to headr to detect ad blocks and display notifications to users.
below is the code for the ad block detection script.
<script> document.addEventListener('DOMContentLoaded', function () { var adBlockEnabled = false; var testAd = document.createElement('div'); testAd.className = 'adsbox'; testAd.style.display = 'none'; document.body.appendChild(testAd); window.setTimeout(function () { if (testAd.offsetHeight === 0) { adBlockEnabled = true; } testAd.remove(); if (adBlockEnabled) { alert('Ad blocker detected, please disable ad or set exception'); } }, 100); }); </script>
how to add the ad block detection script code
- go to your WordPress admin page.
- select [Appearance] -> [Theme File Editor].
- open the
header.php
file of your activated theme, and add the above code just below the<head>
tag. - save and test.
settingadditional content access restriction code
additionally, you can block or restrict site content when an ad blocker is detected, making your site unavailable to visitors unless they disable their ad blocker.
enable the plugin’s built-in content blocking functionality, or add JavaScript code like this
if (adBlockEnabled) { document.body.innerHTML = '<h1>Ad blocker detected:</h1><p>Please disable your ad blocker to use the site:</p>'; }