Plugin Fix for WordPress “Edit Post” Cache Bug


Lately, after upgrading all of my blogs to the latest WordPress version, I've noticed a strange behavior when editing my posts. It appears that whenever I pressed "Save," the post content would not update on the administration console. On the other hand, it would update on the main site.

For example, if I edited a post, everything from the title to the actual body of the article would not change. I would still see the original content when logged into the administration console. But if I viewed my site, everything would appear normally. The changes would only have reflected on the actual public portion of the blog! Even weirder was that when I checked my MySQL database, nowhere was any record of the original version! So where was WordPress pulling this outdated post data from?



Last night, I was getting really pissed fighting this problem. So, I scoured the message boards for choice keywords related to my dilemma. The following threads were really helpful in diagnosing the problem:

WordPress Caching

Apparently, this glitch has to do with the new WordPress caching system. For some strange reason, the developers of WordPress (Don't get me wrong! They're awesome!) implemented caching in the administration console. Everyone knows that this is overkill and unnecessary! Server-side caching is best employed when a wide audience is accesses a page. Usually, only one person sees the administration console, five people tops.

Plugin Fix

So, after reading the threads, I took a member's suggestion of writing a plugin. But, instead of implementing a button that I would manually have to pressed each time things are acting up (like the person suggested), I wrote a plugin that automatically clears the cache on each administration page load.

I'm providing this plugin to the public so people will not have to go through the same ordeal. Just paste this code into a uniquely named *.php file in the "plugins" directory (Example: "admin_cache.php").


  1. span style="color:#008000;">/*
  2. Plugin Name: Admin Cache Disabler
  3. Plugin URI: http://www.hackernotcracker.com
  4. Description: A glitch in some WordPress installations does no update the "Write Post" (Edit Post) page after pressing "Save." This bug is due to the caching system in WordPress. This plugin flushes the cache on each page load in the administration console. THIS PLUGIN ONLY WORKS WITH WP 2.0 AND ABOVE!
  5. Author: Allan Barizo
  6. Version: 1.0
  7. Author URI: http://www.hackernotcracker.com
  8. */'admin_head', 'wp_cache_flush'

If you enjoyed this post, make sure you subscribe to hacker not cracker via RSS feed or email update!

Additional Reading

Comment View Comments from Other Readers

Popular Posts

Featured Posts

Related Posts

Recent Posts

What's Your Reaction?

Subscribe to this Blog:

Reader Reactions Elsewhere


18 Responses to “Plugin Fix for WordPress “Edit Post” Cache Bug”

  1. YAWPU Says:

    Hi! Thanks for this GREAT plugin; not the most flashy but one of the most USEFUL one may find, when struck by the "Write page gives me an older version" syndrome... Ok, I installed it a few days ago, and it would work great, what a relief... but now it seems to do it again :((( I tried deactivate/reactivate but it still gives me an older version at times, so I need to use the "Cache Swoosh" plugin (which still seems to work). Any idea? And thank you again. I though maybe, as a complement, someone could come up with a simple "Cache swoosh" direct link in Admin links general menu. FWIW.

  2. hacker not cracker Says:

    I looked at the code in the "Cache Swoosh" plugin (http://rane.hasitsown.com/blog/plink/technical/31/plugin-to-flush-wordpress-cache/) and I really found no difference in the core functionality. Both my plugin and the Cache Swoosh plugin use the same function wp_cache_flush(); to flush the cache.

  3. HYPERGURU Says:

    just installed your plugin into my WP 2.0.2 and I still get the old content in the edit post field while the preview is update.

    I would really need to know how to solve this.

    Many thanks.


  4. blogger Says:

    Really, I cannot find any reason why it doesn't work. But if you are desperate, I suggest that you temporarily turn of the cache. In the wp-config.php file, insert this line of code, "define('DISABLE_CACHE', true);"

  5. HYPERGURU Says:

    Thanks, really.

    I did what you suggested, actually. It worked. What really strikes me is that WordPress is still performing exceptionaly well, even without cache.

    Thanks very much for your time and your disturb in responding me.


  6. blogHelper » WordPress Post Editing Bug and Solution Says:

    [...] Thank god there’s actually a solution for this. And blur me didn’t notice it until today even though a plugin fix was published three months back. ZZZzzz… [...]

  7. Noscope | WP-Cache Not Clearing When Comments Are Posted! Anyone Else Experiencing This? Says:

    [...] Except, this doesn’t work for me. I have scoured the web, including the WordPress forums. People seem to have all sorts of problems, some have even created plugins to purge the cache when the admin loads. Am I missing something? Isn’t WP-Cache supposed to purge the static files when content is updated? And if not, shouldn’t there at least be an option to tell it to do so? [...]

  8. WP-Cache Not Clearing When Comments Are Posted! Anyone Else Experiencing This? | Noscope Says:

    [...] including the WordPress forums. People seem to have all sorts of problems, some have even created plugins to purge the cache when the admin loads. Am I missing something? Isn’t WP-Cache supposed to purge the static files when content is [...]

  9. Kayleigh Says:

    I'm really impressed together with your writing skills as well as with the layout to your blog.

    Is that this a paid theme or did you customize
    it yourself? Either way keep up the excellent quality
    writing, it is rare to see a great weblog like this one

    My weblog; Kayleigh

  10. air structure Says:

    air structure...

    Keep in mind though that it nevertheless significant which you get your concept shipped for your consumers within the clearest and many beneficial way. So even when you've got coupon codes, make sure that the style and message are nicely created. For ...

  11. cialis Says:

    WOW just what I was searching for. Came here by searching
    for acheter pharmacie

    Here is my web site: cialis

  12. www.bonbons-perles-des-vosges.fr Says:

    Neuhaus had little competition, since few other confectionary
    makers could keep up with the complicated flavors he
    created. This is because they can be given out in various occasions such as
    birthdays, anniversaries, get-togethers, and a whole
    lot more. First off, working from your own home can be very isolating.

    Look at my homepage: emballages bonbons (http://www.bonbons-perles-des-vosges.fr)

  13. http://borney.fr/fr/pavillonnerie-et-drapeaux/pavillonnerie-de-loisirs Says:

    fabriquer un drapeau - Borney.fr - banderole publicitaire - fabrication en france Achat drapeaux, fabricant de drapeaux français banderolles publicitaires
    This website really has all the info I wanted concerning this subject and didn't know who to ask.

    Look at my blog bandrolle (http://borney.fr/fr/pavillonnerie-et-drapeaux/pavillonnerie-de-loisirs)

  14. Www.Youtube.Com Says:

    assigned a Fortune 1000 company as your client and you.
    You2bile is one of those Sony Ericsson W995 apps that offers the opportunity to view You -
    Tube videos on the mobile phone. There may be many Nokia hacks to check the date of birth
    of the phone but the better Nokia hack to know
    the exact age of your phone is the combination *#92702689#.

    My page Gmail Password Hack (http://Www.Youtube.Com)

  15. Fifa 14 Pc Download ITA Says:

    I really like it when folks come together and share ideas.
    Great site, continue the good work!

  16. Dessie Says:

    Hey there! Do you know iff they make anny plugins
    to protect against hackers? I'm kinda paranod about losing everything I've
    worked hqrd on. Any suggestions?

    Here is my blog post: buy garcinia cambogia blast - Dessie -

  17. peliculas online Says:

    This is very attention-grabbing, You are an excessively skilled
    blogger. I've joined your rss feed and look ahead to in search of more of your great post.
    Also, I have shared your website in my social networks

  18. Locksmith hermitage tennessee Pricing Says:

    Wow, marvelous weblog layout! How long have you been blogging for?
    you make running a blog glance easy. The full glance
    of your web site is wonderful, as neatly as the content material!

    my web blog; Locksmith hermitage tennessee Pricing

© 2006 and web design of Allan Ray Barizo from [art] [⁄app].
This site is best viewed with FF and at least 1024x768 resolution.