WP Super-Cache Not Deleting Expired Pages

I recently tweaked our blog template and was surprised to see a large number of pages were still displaying the old template! Obviously these pages were being displayed by WP Super-cache, but I had already deleted the wordpress cache, so how was it possible?

I was using the latest version of WP-super-cache 0.8.4 (like most wordpress users), a superb must-have plugin that provides a very fast caching module for WordPress, which means your site can easily survive a Digg on a shared server. When I checked the Supercache admin panel, it showed the counter stuck at 1183 expired files in supercache, and it would not change whatever you do.

WP-Supercache Not Deleting Expired Pages

After repeated attempts I simply could not delete the Super cache expired files – I tried turning the plugin on and off, tried to turn it half on (WP-cache only, Supercache disabled), supercache compression on and off, delete cache button, delete expired button… but nothing helped.

The first time I had installed WP-supercache a few months back, it was not caching pages, but I fixed the issue. This time however the problem refused to get fixed. I simply could not let 1183 frequently visited pages on the site show outdated pages with an older template.

Switch to Older Version of WP-Supercache

I realized the problem had occurred since I installed the latest version of WP-supercache recently by plugin autoupgrade. The changelog revealed some change was recently made to garbage collection timing. Someone suggested I try the WP Super Cache Cleaner WordPress plugin that will periodically delete expired super-cache files regardless of whether your blog has reached the X requests threshold. However, only expired super-cached files will be deleted and WP-Cache files wont be affected.

Since it would take time before more users reported the issue, a bug was identified, and a new version released, I decided to switch back to the previous version. But where could I find the previous version of WP-supercache?

Fortunately wordpress plugin headquarters archive all older plugin versions. I found the older version of WP-Super-cache (0.8.3) there and downloaded it. Then after backing up my current WP-supercache folder from the server, I uploaded the older version. Then I reactivated the plugin, pressed delete cache and… Expired pages = 0

More Supercache Experiments

UPDATE: WP-super-cache stopped working again after switching back to an older version. Till then manually deleting the cache seemed to be the reasonable option to keep the site going. I then switched back to the latest version. And here is how I proceeded further.

Under wp-content/cache/supercache/ there were hundreds of folders. I deleted all of them, but some folders refused to get deleted and had strange triple backslashes.

directory not empty

Undeleted folders

I figured maybe these folders were causing the cache to get stuck. Since these folders were undeletable via my FTP client Filezilla, I had to login via Shell using puTTY and delete these folders. Once the Supercache folder was empty, I tried to deactivate and reactivate. Still not working.

Now based on my previous experiences I deleted advanced-cache.php link in wp-content. Then I temporarily gave 777 priveleges to wp-content, again deactivated and reactivated the plugin, a new advanced-cache.php was created automatically, switched back wp-content to 755 and behold – the caching started as normal.

This is my personal experience, I am no professional expert in this, try it at your own risk.

Share with friends

About the Author: P Chandra is editor of QOT, one of India's earliest tech bloggers since 2004. A tech enthusiast with expertise in coding, WordPress, web tools, SEO and DIY hacks.