Title: Adding support for DONOTCACHEPAGE
Last modified: October 5, 2019

---

# Adding support for DONOTCACHEPAGE

 *  [Samuel Aguilera](https://wordpress.org/support/users/samuelaguilera/)
 * (@samuelaguilera)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/adding-support-for-donotcachepage/)
 * Hi!
 * I would like to exclude certain pages from caching dynamically using DONOTCACHEPAGE
   constant. As you may know this is a constant supported by most caching/optmization
   plugins, for example:
 * * WP Super Cache
    * W3 Total Cache * WP Rocket * Autoptimize * SG Optimizer *
   Comet Cache
 * But for some reason WP Fastest Cache doesn’t support it 🙁
 * Looking at the plugin code I can see it’s only accepted on a very specific use
   case, pages with 503 error when Wordfence is active:
 *     ```
       			// for Wordfence: not to cache 503 pages
       			if(defined('DONOTCACHEPAGE') && $this->isPluginActive('wordfence/wordfence.php')){
       				if(function_exists("http_response_code") && http_response_code() == 503){
       					return $buffer."<!-- DONOTCACHEPAGE is defined as TRUE -->";
       				}
       			}
       ```
   
 * Would be great if you can add support to exclude any page where DONOTCACHEPAGE
   is set to true, no matter if Wordfence is enabled or if it’s a 503 error page.
 * You would need only to remove the extra checkings from that if statement, or 
   add a new one before it with only DONOTCACHEPAGE checking if you don’t want to
   change the above snippet. I would love to submit a pull request if you have a
   Github repo (I was unable to find any).
 * Being your caching plugin so popular, I’m sure many users would be happy of seeing
   this added.
 * Thanks!

Viewing 1 replies (of 1 total)

 *  Plugin Author [Emre Vona](https://wordpress.org/support/users/emrevona/)
 * (@emrevona)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/adding-support-for-donotcachepage/#post-12002016)
 * Hi, I added this condition because of a problem. On some wp sites DONOTCACHEPAGE
   is defined for all sites and in this case no page can be cached.
 * If you add [wpfcNOT] on the html of single page, the page is not cached.

Viewing 1 replies (of 1 total)

The topic ‘Adding support for DONOTCACHEPAGE’ is closed to new replies.

 * ![](https://ps.w.org/wp-fastest-cache/assets/icon-256x256.png?rev=2064586)
 * [WP Fastest Cache - WordPress Cache Plugin](https://wordpress.org/plugins/wp-fastest-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-fastest-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-fastest-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-fastest-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-fastest-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-fastest-cache/reviews/)

## Tags

 * [DONOTCACHEPAGE](https://wordpress.org/support/topic-tag/donotcachepage/)

 * 1 reply
 * 2 participants
 * Last reply from: [Emre Vona](https://wordpress.org/support/users/emrevona/)
 * Last activity: [6 years, 7 months ago](https://wordpress.org/support/topic/adding-support-for-donotcachepage/#post-12002016)
 * Status: not resolved