Title: Ability to programmatically clear cache for a specific post.
Last modified: March 5, 2026

---

# Ability to programmatically clear cache for a specific post.

 *  Resolved [PthPndr](https://wordpress.org/support/users/pthpndr/)
 * (@pthpndr)
 * [3 months, 1 week ago](https://wordpress.org/support/topic/ability-to-programmatically-clear-cache-for-a-specific-post/)
 * According to the changelog starting with version 2.4.0 you can programmatically
   purge the cache for a single post. Does anyone have any idea on how to do this?
 * I tried poking through the code but nothing stood out.
 * Thank you.

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

 *  Plugin Author [owaisalam](https://wordpress.org/support/users/owaisalam/)
 * (@owaisalam)
 * [3 months ago](https://wordpress.org/support/topic/ability-to-programmatically-clear-cache-for-a-specific-post/#post-18845230)
 * Hi there!
 * You can programmatically clear cache for a specific post using this WordPress
   action:
 * do_action( ‘purge_post_cache’, $post_id );
 * Replace $post_id with your actual post ID (e.g., 123).
 * Example Usage
 * // Clear cache for post ID 123
   do_action( ‘purge_post_cache’, 123 );
 * You can add this to your theme’s functions.php or custom plugin.
 * Hope this helps!
 *  Thread Starter [PthPndr](https://wordpress.org/support/users/pthpndr/)
 * (@pthpndr)
 * [3 months ago](https://wordpress.org/support/topic/ability-to-programmatically-clear-cache-for-a-specific-post/#post-18848287)
 * Thank you, I don’t know how I missed that.

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

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fability-to-programmatically-clear-cache-for-a-specific-post%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

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

 * 2 replies
 * 2 participants
 * Last reply from: [PthPndr](https://wordpress.org/support/users/pthpndr/)
 * Last activity: [3 months ago](https://wordpress.org/support/topic/ability-to-programmatically-clear-cache-for-a-specific-post/#post-18848287)
 * Status: resolved