ST AdBlocker Detector
A WordPress plugin that detects ad blocker extensions and blocks website access until the visitor disables it.
by Sampath Tharanga · github.com/sampaththaranga/st-adblocker-detector · website
★ 1stars
0forks
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/sampaththaranga/st-adblocker-detector/archive/refs/heads/main.zipA WordPress plugin by Sampath Tharanga
Detects ad blocker browser extensions and completely blocks website access until the visitor disables their ad blocker.
Features
- Detects all major ad blockers (uBlock Origin, AdBlock Plus, etc.)
- Full-page overlay blocks site access when ad blocker is detected
- Customizable popup title, message, and buttons
- Overlay background color & opacity control
- Blur background effect
- Randomized CSS class names to evade ad-blocker blocklists
- NoScript fallback for JavaScript-disabled browsers
- Hide on mobile option
- Clean, modern admin settings panel
- Lightweight — no jQuery dependency on frontend
Installation
- Download the latest release ZIP from the Releases page
- Go to WordPress Admin → Plugins → Add New → Upload Plugin
- Upload the ZIP file and click Activate
- Navigate to ST AdBlock in the admin menu to configure settings
Requirements
- WordPress 5.2 or higher
- PHP 7.2 or higher
Settings
| Option | Description |
|---|---|
| Enable Plugin | Turn detection on or off |
| Popup Title | Heading shown in the popup |
| Message Content | Body text (supports HTML via WP Editor) |
| Popup Width | Width of the popup box (in %) |
| Overlay Color | Background color of the overlay |
| Overlay Opacity | Transparency of the overlay (50–100%) |
| Blur Background | Blurs the site content behind the overlay |
| Refresh Button | Show/hide with custom label |
| Close Button | Show/hide with custom label |
| Hide on Mobile | Skip detection on mobile devices |
| NoScript Fallback | Block users with JavaScript disabled |
| Header Injection | Inject scripts via wp_body_open hook |
Screenshots
Frontend — Ad Blocker Detected Overlay
License
GPL v2 or later — see LICENSE
Developer
Sampath Tharanga
References & Inspiration
This plugin was built with reference to the architecture and detection techniques used in the following open-source WordPress plugin:
| Detail | |
|---|---|
| Plugin Name | CHP Ads Block Detector |
| Author | Suresh Chand |
| Author URI | https://sureshchand.com.np |
| Plugin URI | https://chpadblock.com |
| License | GPL v2 or later |
Concepts referenced from CHP Ads Block Detector:
- Google Ads script probe — Loading
pagead2.googlesyndication.com/pagead/js/adsbygoogle.jsand checking ifwindow.adsbygoogleis defined, as a reliable method to detect network-level ad blockers. - CSS class-based detection — Injecting a hidden decoy
<div>with common ad-related class names (.adsbox,.adsbygoogle,.Ad-Container, etc.) and checking if it gets hidden by the ad blocker. - FairAdblock detection — Checking for the presence of a
#stndz-styleelement injected by the FairAdblock extension. - Randomized class names — Generating obfuscated, site-specific CSS class names to prevent ad blockers from targeting the overlay by class name.
- NoScript fallback — Wrapping the block overlay in a `