Title: Clear cache from custom function
Last modified: September 15, 2022

---

# Clear cache from custom function

 *  Resolved [DaltonBross](https://wordpress.org/support/users/tasoft/)
 * (@tasoft)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/clear-cache-from-custom-function/)
 * Hi, is it possible to clear cache from a custom function?
    Regards

Viewing 1 replies (of 1 total)

 *  Plugin Support [Tsvetan Mitev](https://wordpress.org/support/users/tsvetanm/)
 * (@tsvetanm)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/clear-cache-from-custom-function/#post-16012584)
 * Hello [@tasoft](https://wordpress.org/support/users/tasoft/),
 * You can use the following public function, to purge the entire cache:
 *     ```
       if (function_exists('sg_cachepress_purge_cache')) {
           sg_cachepress_purge_cache();
       }
       ```
   
 * Alternatively, you can pass an URL to the function to clear the cache for this
   specific page, instead of flushing the entire cache:
 *     ```
       if (function_exists('sg_cachepress_purge_cache')) {
           sg_cachepress_purge_cache('https://yoursite.com/pluginpage');
       }
       ```
   
 * For more details please refer to our official documentation:
    [https://wordpress.org/plugins/sg-cachepress/](https://wordpress.org/plugins/sg-cachepress/)
 * The cache purging and exclude functions can be found in the “Plugin Compatibility”
   section.
 * Best Regards,
    Tsvetan Mitev

Viewing 1 replies (of 1 total)

The topic ‘Clear cache from custom function’ is closed to new replies.

 * ![](https://ps.w.org/sg-cachepress/assets/icon-256x256.gif?rev=2971889)
 * [Speed Optimizer - The All-In-One Performance-Boosting Plugin](https://wordpress.org/plugins/sg-cachepress/)
 * [Support Threads](https://wordpress.org/support/plugin/sg-cachepress/)
 * [Active Topics](https://wordpress.org/support/plugin/sg-cachepress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/sg-cachepress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/sg-cachepress/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Tsvetan Mitev](https://wordpress.org/support/users/tsvetanm/)
 * Last activity: [3 years, 8 months ago](https://wordpress.org/support/topic/clear-cache-from-custom-function/#post-16012584)
 * Status: resolved