Title: CaphLabs &#8211; Advanced Ad Blocker Fence
Author: CaphLabs
Published: <strong>❄️2️⃣ 27, 2026</strong>
Last modified: ❄️2️⃣ 27, 2026

---

Search plugins

![](https://ps.w.org/caphlabs-advanced-ad-blocker-fence/assets/banner-772x250.png?
rev=3471381)

![](https://ps.w.org/caphlabs-advanced-ad-blocker-fence/assets/icon-256x256.png?
rev=3471381)

# CaphLabs – Advanced Ad Blocker Fence

 By [CaphLabs](https://profiles.wordpress.org/ipodguy79/)

[Download](https://downloads.wordpress.org/plugin/caphlabs-advanced-ad-blocker-fence.1.0.0.zip)

 * [Details](https://emoji.wordpress.org/plugins/caphlabs-advanced-ad-blocker-fence/#description)
 * [Reviews](https://emoji.wordpress.org/plugins/caphlabs-advanced-ad-blocker-fence/#reviews)
 *  [Installation](https://emoji.wordpress.org/plugins/caphlabs-advanced-ad-blocker-fence/#installation)
 * [Development](https://emoji.wordpress.org/plugins/caphlabs-advanced-ad-blocker-fence/#developers)

 [Support](https://wordpress.org/support/plugin/caphlabs-advanced-ad-blocker-fence/)

## Description

Ad blockers can reduce the revenue that keeps your site running. **CaphLabs – Advanced
Ad Blocker Fence** helps you respond in a user-friendly way:

 * Detects common ad blocking behavior (including blocking Google Ad scripts).
 * Optionally shows a **small warning tag** for a set number of adblocked page views(
   grace pages).
 * Then displays a **fence popup** asking visitors to whitelist your site or disable
   their blocker.
 * Includes optional **refresh** and **close** buttons, with configurable button
   text.
 * Uses lightweight assets and can render in the **footer** or via **wp_body_open**.

This plugin is designed to be simple to set up: enable it, write your message, decide
your grace count, and you’re done.

### TESTED WITH:

 * ✓ Adblock Plus
 * ✓ Adblock
 * ✓ ExpressVPN Keys
 * ✓ Tampermonkey
 * ✓ NordVPN
 * ✓ AdLock
 * ✓ Total Adblock
 * ✓ Adguard
 * ✓ Privacy Badger
 * ✓ Adremover
 * ✓ Adblock for Chrome™
 * ✓ Brave
 * ✓ Surfshark CleanWeb
 * ✓ Ghostery
 * ✓ uBlocker
 * ✓ Pi-hole
 * ✓ uBlock Origin
 * ✓ Ultrablock
 * ✓ Privacy Badger
 * ✓ DuckDuckGo
 * ✓ Disconnect
 * ✓ Microsoft Edge AdBlock extension
 * ✓ Firefox Tracking Protection
 * ✓ uBlock Origin
 * ✓ Fair AdBlocker
 * ✓ Hola ad remover
 * ✓ Comodo AdBlocker
 * ✓ Opera Built-in AdBlock extension

> Note: Ad blockers change frequently. The list above reflects testing on common
> blockers and privacy tools, but no detection method can guarantee 100% coverage
> forever.

### External Services

This plugin connects to external services:

1) Google AdSense script (ad blocker detection)
 This plugin loads https://pagead2.
googlesyndication.com/pagead/js/adsbygoogle.js to detect when ad scripts are blocked.
This helps determine whether an ad blocker is active. Data sent: This plugin does
not intentionally collect or transmit personal data as part of this detection. Google
Terms: https://policies.google.com/terms Google Privacy Policy: https://policies.
google.com/privacy

2) Freemius checkout (optional Pro upgrade)
 This plugin may link to Freemius hosted
checkout pages if you choose to upgrade to the Pro version. Data sent: If you click
an upgrade/trial link and complete checkout, information you provide during checkout
is handled by Freemius. Freemius Terms: https://freemius.com/terms/

Freemius Privacy Policy: https://freemius.com/privacy/

### How it works (plain-English, step-by-step)

### 1) The plugin loads your saved settings

Your settings are stored by the plugin and read on each request to decide whether
to output the fence markup/scripts and how to behave (grace count, button visibility,
etc.).

### 2) Front-end CSS is loaded early (wp_head)

The plugin outputs its front-end CSS so the popup and grace tag can display correctly
and immediately.

### 3) Front-end JavaScript is output (wp_footer or wp_body_open)

Depending on your setting (**Include in Header**), the plugin outputs the fence 
markup + JavaScript in one of these locations:

 * **Default:** `wp_footer` (most compatible)
 * **Optional:** `wp_body_open` (earlier output; requires theme support)

If your theme does not support `wp_body_open`, the plugin safely falls back to the
footer.

### 4) Detection runs in the browser

The plugin uses a practical “real world” detection approach:

 * It attempts to load Google’s Ads script (`adsbygoogle.js`).
 * If the script is blocked or fails in certain ways, ad blocking is assumed.
 * It also performs additional lightweight checks to handle blockers that intercept
   requests or alter responses.

### 5) Grace countdown (optional)

If **Fence after (adblocked pages)** is set above 0:

 * The plugin shows a small warning tag (not the full popup) while the visitor is
   still within their grace limit.
 * Once the visitor exceeds the grace limit on adblocked page views, the full fence
   popup appears.

This helps avoid instantly “slamming the door” on first-time visitors while still
protecting your monetization over time.

### 6) Fence popup behavior

When the popup is shown:

 * Your **Title** and **Content** are displayed.
 * The visitor can:
    - Click the **Refresh** button (if enabled) to reload after whitelisting
    - Click the **Close** button (if enabled) to dismiss (depending on your configuration)

### 7) Reset countdown after X days (optional)

If the visitor stops triggering adblock detection for a while, the plugin can reset
the grace counter after your configured number of days.

### Settings page: Every option explained (point-by-point)

Go to: **WP Admin  Settings  Advanced Ad Blocker Fence** (or wherever your plugin
places its menu entry).

### Enable Fence

Turns the plugin on/off. When disabled, the plugin does not show the fence.

### Enable Noscript

Adds a `<noscript>` fallback message for users who have JavaScript disabled.

Why it matters:
 – Adblock detection is primarily JavaScript-based. – A noscript
message ensures users with JS disabled still see guidance.

### Title

The headline shown on the fence popup.

Tips:
 – Keep it short and clear (example: “Please support our site”). – Avoid aggressive
language; polite messaging improves whitelist rates.

### Content

A small WYSIWYG editor for the popup body text.

Use it to explain:
 – Ads help fund hosting/content – How to whitelist your site(
simple steps) – A friendly “thank you”

Note:
 – The editor is intentionally lightweight (limited toolbar) to keep output
clean.

### Width (in %)

Controls how wide the popup content area is as a **percentage**.

Examples:
 – 40 = compact popup – 60 = larger popup for more text – 80 = very wide
popup (use carefully on mobile)

### Fence after (adblocked pages)

This is your grace counter.

 * **0** = show the fence immediately on the first detected adblocked page view
 * **3** = show the warning tag for 3 adblocked page views, then fence on the next

Recommended starting point:
 – 2–3 grace pages for content sites – 0 grace pages
for high-monetization landing pages (use cautiously)

### Reset countdown after (days)

If adblock is detected again after this many days without a warning, the countdown
resets back to the full value.

Examples:
 – 7 = weekly reset (reasonable default) – 30 = monthly reset

### Show Refresh Button

When enabled, a “refresh” button is shown in the popup.

Typical use:
 – Visitor whitelists your site – Visitor clicks refresh to reload 
the page cleanly

### Refresh Button (Text)

Changes the refresh button label.

Examples:
 – “I whitelisted — refresh” – “Refresh page” – “Try again”

### Show Close Button

When enabled, shows a close/dismiss button on the popup.

Site owners often choose:
 – Enable close for softer approach (less friction) – 
Disable close for stricter enforcement

### Close Button (Text)

Changes the close button label.

Examples:
 – “Close” – “Not now” – “Continue without ads” (avoid promises you can’t
enforce)

### Include in Header

If enabled, the plugin will attempt to output the fence JS earlier using `wp_body_open`.

Important:
 – Your theme must support the `wp_body_open` hook – If not supported,
the plugin automatically falls back to footer output

### Minify JS

Enables an optional inline script packing toggle (where applicable) to reduce output
size and make the front-end logic harder to fingerprint.

Note:
 Some caching/minify plugins already compress JavaScript globally. If you 
experience conflicts, disable this option and let your caching plugin handle optimization.

### Branding

Free version includes a small “Powered by” style badge while the popup is open.

“Branding is optional / administrator opt-in” And extremely appreciated <3

—

### Developer notes (hooks/filters)

This plugin exposes filters that allow advanced users to alter behavior.

If you are building custom integrations, you may encounter legacy filter names. 
Some are preserved for backward compatibility.

Common examples include:
 – Minify toggle filter – Branding behavior filter – Icon
and HTML icon customization filters

(Exact hook names may differ by version/build. If you rely on hooks, test after 
updating.)

## Screenshots

[⌊Settings page (all options)⌉⌊Settings page (all options)⌉[

Settings page (all options)

[⌊Grace warning tag (small notice before fence)⌉⌊Grace warning tag (small notice
before fence)⌉[

Grace warning tag (small notice before fence)

[⌊Fence popup (title/content/buttons)⌉⌊Fence popup (title/content/buttons)⌉[

Fence popup (title/content/buttons)

[⌊Example of PRO version settings⌉⌊Example of PRO version settings⌉[

Example of PRO version settings

[⌊Example of PRO version settings⌉⌊Example of PRO version settings⌉[

Example of PRO version settings

[⌊Example of PRO version settings⌉⌊Example of PRO version settings⌉[

Example of PRO version settings

## Installation

 1. Upload the plugin folder to `/wp-content/plugins/` or upload the ZIP via **Plugins
    Add New  Upload Plugin**.
 2. Activate **Advanced Ad Blocker Fence** through the **Plugins** menu.
 3. Go to the plugin settings page.
 4. Enable the fence and configure your message and grace count.
 5. Test in an incognito/private window with an ad blocker enabled.

### Recommended testing workflow

 * Open your site in a private window with **uBlock Origin** enabled
 * Visit 2–4 pages (depending on your grace setting)
 * Confirm the warning tag appears first (if grace > 0)
 * Confirm the popup appears after grace is exceeded
 * Disable the blocker and use the refresh button to verify recovery

## FAQ

### Why don’t I see the popup when I’m using an ad blocker?

Common causes:
 – You have aggressive page caching serving a cached “non-adblock”
version. – Your theme does not support `wp_body_open` and you forced header output.–
Another plugin is combining/minifying scripts in a way that breaks inline JS.

Fix:
 – Temporarily disable cache/minify, then retest. – Use footer output mode 
for best compatibility. – Clear Cloudflare/CDN cache if applicable.

### What is “grace pages” and why would I use it?

Grace pages lets visitors browse a few adblocked pages with only a small warning
tag before the full fence appears. It’s a friendlier approach that can improve retention
while still encouraging whitelisting.

### Does the plugin block content completely?

It can enforce a popup/fence overlay. Exact strictness depends on your settings (
for example, whether you allow a close button).

### Will this work with every ad blocker forever?

No plugin can guarantee permanent 100% detection coverage because blockers evolve.
This plugin uses practical detection and is tested against common blockers, but 
it may require updates over time.

### Can I change the message and buttons?

Yes. Title, content, and button labels are configurable from the settings page.

### Does it work on mobile?

Yes. The popup is styled to work on responsive layouts. Adjust “Width (in %)” if
you need a tighter mobile feel.

### My theme doesn’t have wp_body_open. Is that a problem?

No. If the theme does not support `wp_body_open`, the plugin falls back to the footer
automatically.

## Reviews

There are no reviews for this plugin.

## Contributors & Developers

“CaphLabs – Advanced Ad Blocker Fence” is open source software. The following people
have contributed to this plugin.

Contributors

 *   [ CaphLabs ](https://profiles.wordpress.org/ipodguy79/)

“CaphLabs – Advanced Ad Blocker Fence” has been translated into 1 locale. Thank 
you to [the translators](https://translate.wordpress.org/projects/wp-plugins/caphlabs-advanced-ad-blocker-fence/contributors)
for their contributions.

[Translate “CaphLabs – Advanced Ad Blocker Fence” into your language.](https://translate.wordpress.org/projects/wp-plugins/caphlabs-advanced-ad-blocker-fence)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/caphlabs-advanced-ad-blocker-fence/),
check out the [SVN repository](https://plugins.svn.wordpress.org/caphlabs-advanced-ad-blocker-fence/),
or subscribe to the [development log](https://plugins.trac.wordpress.org/log/caphlabs-advanced-ad-blocker-fence/)
by [RSS](https://plugins.trac.wordpress.org/log/caphlabs-advanced-ad-blocker-fence/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

#### 1.0.0

 * Initial public release
 * Adblock detection + grace pages
 * Customizable title/content/buttons
 * Footer/wp_body_open output modes
 * Optional noscript support

## Meta

 *  Version **1.0.0**
 *  Last updated **8 months ago**
 *  Active installations **Fewer than 10**
 *  WordPress version ** 5.8 or higher **
 *  Tested up to **6.9.10**
 *  PHP version ** 7.2 or higher **
 *  Languages
 * [English (US)](https://wordpress.org/plugins/caphlabs-advanced-ad-blocker-fence/)
   and [Russian](https://ru.wordpress.org/plugins/caphlabs-advanced-ad-blocker-fence/).
 *  [Translate into your language](https://translate.wordpress.org/projects/wp-plugins/caphlabs-advanced-ad-blocker-fence)
 * Tags
 * [adsense](https://emoji.wordpress.org/plugins/tags/adsense/)[anti-adblock](https://emoji.wordpress.org/plugins/tags/anti-adblock/)
   [monetization](https://emoji.wordpress.org/plugins/tags/monetization/)[patreon](https://emoji.wordpress.org/plugins/tags/patreon/)
   [paywall](https://emoji.wordpress.org/plugins/tags/paywall/)
 *  [Advanced View](https://emoji.wordpress.org/plugins/caphlabs-advanced-ad-blocker-fence/advanced/)

## Ratings

No reviews have been submitted yet.

[Your review](https://wordpress.org/support/plugin/caphlabs-advanced-ad-blocker-fence/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/caphlabs-advanced-ad-blocker-fence/reviews/)

## Contributors

 *   [ CaphLabs ](https://profiles.wordpress.org/ipodguy79/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/caphlabs-advanced-ad-blocker-fence/)