DeBlocker+ is not limited to WordPress. Any website running on a PHP server can use the DeBlocker+ PHP integration method to enable ad blocker detection on stacks such as custom CMSs, Laravel, Symfony, static sites with a PHP runtime, or any standard LAMP/LEMP setup. This guide walks through the full setup for non-WordPress sites.
Running WordPress? Use the dedicated DeBlocker Plus WordPress plugin instead: it handles the proxy and script loading automatically. Refer to the WordPress plugin guide for setup instructions.
Requirements
Before starting, make sure your environment meets the following requirements:
- NGINX or Apache web server with
mod_rewriteenabled. - PHP 7.4 or newer.
- FTP or File Manager access in your hosting control panel.
- An active Premium plan in your DeBlocker+ dashboard.
Before You Start
The DeBlocker PHP integration uses two values from your DeBlocker+ dashboard. Open Websites → your site domain, then go to Integration → PHP:
- Referer: your website URL.
- API Key: the unique key for your site.
The dashboard pre-fills these values automatically into the code snippets shown on the Integration tab, so you can copy each snippet without manual editing.
DeBlocker PHP Integration Steps
Step 1: Access your website files
The DeBlocker PHP integration is installed via your server’s filesystem. Connect to your website via FTP, or open the File Manager in your hosting control panel.
Step 2: Create the proxy file
In the root directory of your website, create a new file named deblocker-proxy.php. You may use a different name, but keep it consistent in the next steps. Set read and execute permissions if your server requires it. This file acts as a proxy between your site and the DeBlocker+ API.
Step 3: Add the proxy code
Copy the PHP snippet from your DeBlocker+ dashboard (Integration → PHP) and paste it into deblocker-proxy.php. The snippet ships with your Referer and API Key already filled in.
For production websites, set CURLOPT_SSL_VERIFYPEER to true in the snippet to enforce SSL certificate verification.
Step 4: Verify the proxy file
Visit the proxy file URL directly in your browser, e.g. https://yoursite.com/deblocker-proxy.php. If the file is wired up correctly, the response is a block of minimized JavaScript code.
Step 5: Choose your assets directory
Decide which folder on your server will serve the DeBlocker+ script. Common choices: /assets, /js, /scripts, or /static. You do not need to create a new directory; an existing one is fine.
Avoid paths that include words like /deblocker, /ad, /ads, /advert, /banner, or /track: ad blockers commonly target those patterns and will block requests outright.
Step 6: Configure the URL redirect
Add the following rewrite rules to your .htaccess file (Apache) to redirect requests from your assets folder to the proxy file. Replace /assets/ with the directory you chose in Step 5.
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/assets/sc.*te\.js$
RewriteRule ^assets/(.*)$ /deblocker-proxy.php?file=$1 [L]On NGINX, translate the same rules into a location block with rewrite directives that point to deblocker-proxy.php.
Step 7: Verify the redirect
Visit the redirected URL in your browser. The response should be the same minimized JavaScript code you saw in Step 4: that confirms the rewrite is in place and the proxy is reachable through the assets path.
Step 8: Add the script call to your JavaScript
Add the following JavaScript snippet to your main JS file: the one loaded on every page. Do not add it as a separate <script> tag in HTML or as a standalone .js file, since ad blockers can easily detect and block both.
(() => {
window.addEventListener('DOMContentLoaded', () => {
const s = document.createElement('script');
s.src = 'https://yoursite.com/assets/sc' + Date.now().toString(16).slice(-4) + 'te.js';
document.body.appendChild(s);
});
})();Replace yoursite.com with your actual domain and /assets/ with the directory you chose in Step 5. With this snippet deployed, the DeBlocker PHP integration is fully wired up and ad blocker detection events will start flowing into your DeBlocker+ dashboard.

