Title: Scheduling cache folder cleanup
Last modified: August 31, 2016

---

# Scheduling cache folder cleanup

 *  Resolved [mikele3](https://wordpress.org/support/users/mikele3/)
 * (@mikele3)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/scheduling-cache-folder-cleanup/)
 * Hello, thank you for the great plugin.
 * Is there a way to schedule a cleanup of the cache folder from inside WordPress?
 * Alternatively, could you tell me where, in your plugin files, I could safely 
   add a “insert(‘myscript.php’);” line to have some code executed before the plugin
   runs?
 * The code would check the current date against a value stored in a database and
   eventually empty the cache folder if criteria are met. I’d do this without the
   need of WP to be loaded, minimising the added overhead.
 * [https://wordpress.org/plugins/hyper-cache/](https://wordpress.org/plugins/hyper-cache/)

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

 *  Plugin Author [Stefano Lissa](https://wordpress.org/support/users/satollo/)
 * (@satollo)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/scheduling-cache-folder-cleanup/#post-6923772)
 * Hi, you should write a specific plugin for that and just clean the cache folder
   of hyper cache as needed. There is no need to hack the plugin code, IMHO.
 *  Thread Starter [mikele3](https://wordpress.org/support/users/mikele3/)
 * (@mikele3)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/scheduling-cache-folder-cleanup/#post-6923773)
 * hello Stefano,
 * I successfully achieved my goal by adding an insert statement at the very top
   of the advanced-cache.php
    file in the wp-content folder.
 * That is, of course, an hack; I’d rather, like you suggested, have my own plugin
   firing before yours, but I couldn’t figure out how to do that.
 *  Thread Starter [mikele3](https://wordpress.org/support/users/mikele3/)
 * (@mikele3)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/scheduling-cache-folder-cleanup/#post-6923774)
 * furthermore, if you’d be available to hire to help me with that, please, do not
   hesitate to contact me.
    thank you!

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

The topic ‘Scheduling cache folder cleanup’ is closed to new replies.

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

## Tags

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

 * 3 replies
 * 2 participants
 * Last reply from: [mikele3](https://wordpress.org/support/users/mikele3/)
 * Last activity: [10 years, 4 months ago](https://wordpress.org/support/topic/scheduling-cache-folder-cleanup/#post-6923774)
 * Status: resolved