This is the PHP Script version of FATS: Force Adblock To Stop Wordpress Plugin:


Easily hide partial or all of your premium content from your users that using AdBlock or Adblocking software. Just add 4 lines of code to your page and it will automatically hide your content without any trouble.


  • Your premium content will be hidden until user deactivate AdBlock.
  • 3 methods to detect adblock.
  • Support for Adsense’s asynchronous and synchronous blocking detection.
  • Support for other ads network and self hosted ads blocking detection.
  • Content will stay hidden if user deactivate cookie or javascript.
  • Hide all or partial content from your page.
  • Hide anything you want in your PHP file.
  • Your content won’t show in Source View.
  • Show your message in JQuery Popup, Javascript Alert or Inline text.
  • Autoredirect page after showing message.
  • Cross browser detection.
  • Easy to setup, less than 5 minutes to setup.
  • Just add 4 lines of code to your page and you’re set.
  • Uses cookies to detect deactivate AdBlock.
  • Highly customizable message and CSS.


My script may not work best inside cached pages. If you are using cache system (plugin, CDN, cloudflare, etc), you may have to reduce the cached time on your pages to under 1 minutes. The lower, the better. But again, my script wasn’t designed to support caching. Setting the cache’s update interval to the minimum may give you the desired result but it will still give false detection for visitors that requesting a same post at the same time. Hopefully with many content that you may have, the false detection ratio is not noticeable.

But in near future I will create another version of my script that support cached system.

Latest Updates

version 1.6 – Feb 24, 2014
  • fixed bug in Cookies with subdirectory
version 1.5 – Jan 5, 2014
  • added auto redirect page after showing message
  • documentation updated
version 1.4 – Jan 1, 2014
  • added jquery popup message option
  • added javascript popup message option
  • documentation updated
version 1.3 – Dec 29, 2013
  • added new method to detect adblock
  • added support for adsense’s asynchronous and synchronous method
  • documentation updated
version 1.2 – Dec 27, 2013
  • added disabled cookie detection in user’s browser
  • added disabled javascript detection in user’s browser
  • documentation updated
version 1.1 – Dec 25, 2013
  • fix a XSS vulnerability
  • rewrite documentation
version 1 – Dec 24, 2013
  • initial release


  • PHP 5.xx (older version may work but they have not been tested).
  • Basic understanding on how to write in PHP.

Inserting FAtS To Your Code

<?php include "fats_core.php"; ?>
<?php write_JS($fats_config ); ?>
Your regular content

<?php if (is_Unlocked($fats_config)){ // START HIDDEN CONTENT ?>

<p>Your premium content</p>

<?php } ///////////////////////////// STOP HIDDEN CONTENT ?>

Your regular content

Looking for something else?

I have created a few items in CodeCanyon that you may want to take a look:

If you have an idea for a website/plugin or you want something to be made, don’t hesitate to contact me.


Flag Counter

You May Also Like