Title: Detect ads being disabled using PHP
Last modified: June 11, 2024

---

# Detect ads being disabled using PHP

 *  Resolved [net](https://wordpress.org/support/users/krstarica/)
 * (@krstarica)
 * [1 year, 12 months ago](https://wordpress.org/support/topic/detect-ads-being-disabled-using-php/)
 * Is it possible to detect using PHP code if the current page has ads disabled 
   using `[adinserter disable="#"]`?

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Spacetime](https://wordpress.org/support/users/spacetime/)
 * (@spacetime)
 * [1 year, 12 months ago](https://wordpress.org/support/topic/detect-ads-being-disabled-using-php/#post-17817886)
 * Hello,
 * there are many ways the insertion of the blocks can be disabled via plugin settings.
   Therefore, this is not possible.
 *  Thread Starter [net](https://wordpress.org/support/users/krstarica/)
 * (@krstarica)
 * [1 year, 12 months ago](https://wordpress.org/support/topic/detect-ads-being-disabled-using-php/#post-17819075)
 * How about:
 * 1) Querying some Ad Inserter global variable or
 * 2) Calling some Ad Inserter function or
 * 3) Using some filter to catch and save the info globally if ad position number
   1 is disabled?
 *  Plugin Author [Spacetime](https://wordpress.org/support/users/spacetime/)
 * (@spacetime)
 * [1 year, 12 months ago](https://wordpress.org/support/topic/detect-ads-being-disabled-using-php/#post-17819402)
 * Not possible as the insertion of a block depends on many settings and also on
   insertion of other blocks. The final status of blocks is known at the end of 
   page generation process when the `wp_footer` actons hook is called and where 
   the code is post-processed. However, it is also possible that some blocks are
   inserted when `the_content` hooks is called but the results are discarded by 
   the theme so the blocks are actually not inserted in the final “visible” page.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Detect ads being disabled using PHP’ is closed to new replies.

 * ![](https://ps.w.org/ad-inserter/assets/icon-256x256.jpg?rev=1502039)
 * [Ad Inserter - Ad Manager & AdSense Ads](https://wordpress.org/plugins/ad-inserter/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ad-inserter/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ad-inserter/)
 * [Active Topics](https://wordpress.org/support/plugin/ad-inserter/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ad-inserter/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ad-inserter/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Spacetime](https://wordpress.org/support/users/spacetime/)
 * Last activity: [1 year, 12 months ago](https://wordpress.org/support/topic/detect-ads-being-disabled-using-php/#post-17819402)
 * Status: resolved