Title: WP-Optimize execute cache flush hook
Last modified: June 28, 2024

---

# WP-Optimize execute cache flush hook

 *  [ms100](https://wordpress.org/support/users/ms100/)
 * (@ms100)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/wp-optimize-execute-cache-flush-hook/)
 * Hi asadkn,
 * The inc/admin/cache.php file does not seem to contain the WP-Optimize code to
   automatically flush the cache for that plugin. Maybe you would like to add that
   piece of code in the next update?
 * Looking forward to your reply 🙂
   Thanks in advance.P.S. I tried to add this piece
   of code, but it did not seem to work:
 * // WP-Optimize
   if (class_exists(‘\WP_Optimize’) && is_callable([‘\WP_Optimize’,‘
   clear_cache’])) {\WP_Optimize::clear_cache();}

Viewing 1 replies (of 1 total)

 *  Thread Starter [ms100](https://wordpress.org/support/users/ms100/)
 * (@ms100)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/wp-optimize-execute-cache-flush-hook/#post-17859205)
 * I am not an educated coder but this seems to work…!
   // WP Optimizeif (class_exists(‘
   WP_Optimize’) && is_callable(array(‘WP_Optimize’, ‘get_page_cache’), ‘purge’)){
   WP_Optimize()->get_page_cache()->purge();}

Viewing 1 replies (of 1 total)

The topic ‘WP-Optimize execute cache flush hook’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/debloat.svg)
 * [Debloat - Remove Unused CSS, Optimize JS](https://wordpress.org/plugins/debloat/)
 * [Support Threads](https://wordpress.org/support/plugin/debloat/)
 * [Active Topics](https://wordpress.org/support/plugin/debloat/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/debloat/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/debloat/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [ms100](https://wordpress.org/support/users/ms100/)
 * Last activity: [1 year, 9 months ago](https://wordpress.org/support/topic/wp-optimize-execute-cache-flush-hook/#post-17859205)
 * Status: not resolved