W3 Total Cache
How to clear cache of a custom taxonomy? (4 posts)

  1. niska
    Posted 3 years ago #

    I know it is possible to programatically clear the cache for a single page/post by using w3tc_pgcache_flush_post($post_id). But how do I do it for a category, tag or a custom taxonomy?

    Please help


  2. niska
    Posted 3 years ago #

    My temporary solution is to add this code into the flush_post function within PgCacheFlush.php

    w3_rmdir($cache->_cache_dir . '/gratis');

    I really wish that there were some kind of filter that I could use instead. Maby something for a future version?

  3. niska
    Posted 3 years ago #

    I just updated to 3.5.1 and my solution (above) now gives an error. What could be wrong?

  4. niska
    Posted 3 years ago #

    It seems as _cache_dir is no longer available, so I had to hard code the path.


    If anyone has a better idea of how to delete a custom file/directory, please let me know.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • W3 Total Cache
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.