Title: clear the cache programmatically
Last modified: January 22, 2025

---

# clear the cache programmatically

 *  Resolved [lajd](https://wordpress.org/support/users/lajd/)
 * (@lajd)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/clear-the-cache-programmatically-2/)
 * How can I clear the cache programmatically using a function?

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

 *  Plugin Author [Till Krüss](https://wordpress.org/support/users/tillkruess/)
 * (@tillkruess)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/clear-the-cache-programmatically-2/#post-18259907)
 * You can Google that 👍
 *  Thread Starter [lajd](https://wordpress.org/support/users/lajd/)
 * (@lajd)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/clear-the-cache-programmatically-2/#post-18262194)
 * I’m referring to clearing the Redis cache through a function or hook that behaves
   the same way as manually hitting Redis > Object Cache > Flush Cache, like described
   in this article [(Automatically flush Redis cache)](https://www.saotn.org/posts/automatically-flush-redis-cache-after-publishing-a-wordpress-post).
   However, it doesn’t seem to be working. Thanks!
 *  Plugin Author [Till Krüss](https://wordpress.org/support/users/tillkruess/)
 * (@tillkruess)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/clear-the-cache-programmatically-2/#post-18262473)
 * `wp_cache_flush()`

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

The topic ‘clear the cache programmatically’ is closed to new replies.

 * ![](https://ps.w.org/redis-cache/assets/icon-256x256.gif?rev=2568513)
 * [Redis Object Cache](https://wordpress.org/plugins/redis-cache/)
 * [Support Threads](https://wordpress.org/support/plugin/redis-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/redis-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/redis-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/redis-cache/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Till Krüss](https://wordpress.org/support/users/tillkruess/)
 * Last activity: [1 year, 4 months ago](https://wordpress.org/support/topic/clear-the-cache-programmatically-2/#post-18262473)
 * Status: resolved