Title: exclude specific php files from caching (post views)
Last modified: September 1, 2016

---

# exclude specific php files from caching (post views)

 *  [wordpresslover7](https://wordpress.org/support/users/wordpresslover7/)
 * (@wordpresslover7)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/exclude-specific-php-files-from-caching-post-views/)
 * Hi,
 * I use Worfence basic caching. Unofrntuately this stops my post views counter 
   working. The post views counter deosn’t count and show views correctly.
 * In Wordefence there is no option to exclude php files from caching. How Should
   I do it ?
 * I tried to exclude specific php files that get views but with no luck. For example:“/
   wp-content/themes/sahifa/framework/parts/meta-post.php
    /wp-content/themes/sahifa/
   sahifa/framework/functions/tie-views.php
 * Here is the tip to solve it in a better way but this is too modest description
   for a non-developer.
    [https://support.wordfence.com/support/solutions/articles/1000074182-is-wordfence-and-falcon-caching-engine-compatible-with-woocommerce](https://support.wordfence.com/support/solutions/articles/1000074182-is-wordfence-and-falcon-caching-engine-compatible-with-woocommerce)
 * Anyone could help me debbug this issue please? Paid gigs also welcome!
 * [https://wordpress.org/plugins/wordfence/](https://wordpress.org/plugins/wordfence/)

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

 *  [WFSupport](https://wordpress.org/support/users/wfsupport/)
 * (@wfsupport)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/exclude-specific-php-files-from-caching-post-views/#post-7518243)
 * Current documentation for exclusion is [here](https://docs.wordfence.com/en/Falcon_Cache#Cache_Exclusions).
   We also provide [an API](https://docs.wordfence.com/en/Wordfence_API) to exclude
   whatever you want from caching.
 * tim
 *  Thread Starter [wordpresslover7](https://wordpress.org/support/users/wordpresslover7/)
 * (@wordpresslover7)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/exclude-specific-php-files-from-caching-post-views/#post-7518248)
 * According to your documentation it looks like a specific php file cannot be excluded
   from cachig in the admin panel.
 * The only way would be API [https://docs.wordfence.com/en/DoNotCache](https://docs.wordfence.com/en/DoNotCache)
 * Tim I need a developer who can solve this problem. Could you do it for me or 
   recommend someone? The problem is wordfence caching which breaks the post views
   counter.
 * I already spoke with Alaa from Wordfence which knows sahifa theme very well and
   now works for Wordfence but he is not a php developer. He recommended asking 
   you that question here. My Gmail: rekinfinansow
 *  Thread Starter [wordpresslover7](https://wordpress.org/support/users/wordpresslover7/)
 * (@wordpresslover7)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/exclude-specific-php-files-from-caching-post-views/#post-7518398)
 * This is the the part of php file I don’t want to cache. How should I apply your
   function donotcache() correctly in this case?
 *     ```
       <?php
       global $get_meta;
       if( ( tie_get_option( 'post_meta' ) && empty( $get_meta["tie_hide_meta"][0] ) ) || $get_meta["tie_hide_meta"][0] == 'no' ): ?>
       <p class="post-meta">
       <?php if( tie_get_option( 'post_views' ) ):
       	$text = __ti( 'Views' );
       	echo tie_views( $text ); ?>
       <?php endif; ?>
       </p>
       <div class="clear"></div>
       <?php endif; ?>
       ```
   

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

The topic ‘exclude specific php files from caching (post views)’ is closed to new
replies.

 * ![](https://ps.w.org/wordfence/assets/icon.svg?rev=2070865)
 * [Wordfence Security - Firewall, Malware Scan, and Login Security](https://wordpress.org/plugins/wordfence/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordfence/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordfence/)
 * [Active Topics](https://wordpress.org/support/plugin/wordfence/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordfence/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordfence/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [wordpresslover7](https://wordpress.org/support/users/wordpresslover7/)
 * Last activity: [9 years, 10 months ago](https://wordpress.org/support/topic/exclude-specific-php-files-from-caching-post-views/#post-7518398)
 * Status: not resolved