WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am working on a plugin (widget) that is using some transients that are updated from time to time.

That said, when these transients are updated, I think I will need to flush the cache to display the new data properly.

Thus, I wonder if have some way to flush the cache only for widget instead of entire cache. Do you guys have some advice?

share|improve this question

if you want to flush the specific cache you can do that: the plugin has functions for that

flush_pgcache();  // Page cache
flush_dbcache();  // Database cache
flush_minify();  // Minify cache
flush_all(); // All caches

and you just need to call it like this:

share|improve this answer
Hey, thanks for your reply. However I was not planning to flush entire cache. I wonder if is possible to flush just the widget area. Do you have any ideas? – Tiago Hillebrandt Jan 8 '14 at 19:11
There was no option/function available to flush widget cache. You have to flush_pgcache(); or flush_dbcache(); based your needs. – palPalani Jan 13 '14 at 13:19
Hey, looks like it is possible to do what I need using Fragment Caching :) Thanks for the help! – Tiago Hillebrandt Jan 26 '14 at 5:16

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.