Under review

W3 Total Cache Crashed my site

randy 2 years ago updated by support (Support) 2 years ago 14 1 duplicate

Current plugin: W3 Total Cache (version 0.13.3)
PHP version 7.0.33

Error Details
An error of type E_ERROR was caused in line 158 of the file -w3-total-cache/Cache_File.php. Error message: Illegal length modifier specified 'f' in s[np]printf call

Duplicates 1

Under review

Thank you for contacting us.

I am sorry to hear that W3 Total Cache crashed your website and our team is happy to help you get this working again.

The first thing I recommend trying is completely removing W3 Total Cache and reinstalling it.

Follow these steps to completely remove W3TC and reinstall it:

  1. Purge Cache
  2. Deactivate and Delete Plugin in the dashboard
  3. Check .htaccess file and remove W3TC configurations (make a backup of the file before deleting)
    W3TC will create many directives in .htaccess file to control the caching behavior. Each section will start and end with comments like "#BEGIN W3TC Page Cache core" and "#END W3TC Page Cache core". Ensure that no residual entries are left over in your .htaccess file after deleting the plugin.
  4. Delete the following files and folders from your /wp-content directory:
    cache folder
    w3tc-config folder
    object-cache.php (if it exists)
    advanced-cache.php (if it exists)
    upgrade folder
    w3-total-cache folder (if it exists)
  5. Delete cached files from your CDN if you are using one
    Besides deleting all the relevant files, if you use CDN then ensure to purge the cached content from your CDN. This is necessary when you enabled minify option in W3TC settings. You should delete the minified and combined scripts and CSS files from your CDN server to avoid the site breaking on the browser.
  6. Go to your WordPress dashboard and reinstall W3 Total Cache

Hopefully that fixes the problem you are seeing, but please let us know if the problem persists.


I am having the same problem even after reinstalling.  It just started this week but I hadn't been updating anything lately.

It only happens when I select the box "Object Cache" (I selected Disk method, I didn't try the others).

Thank you for letting us know about this!  I have reported this issue to our developers and I hope that we can figure out a solution for this soon!

Exact same thing for me. I updated wordpress yesterday and this morning I have the issue. When I remove the plugin my site runs okay, but as soon as I reinstall, it crashes and I can't do anything

Thank you for contacting us!

Does the crash happen immediately after installing W3 Total Cache or is it only after the plugin is activated?

Immediately after re-installing W3. I've had it on my blog for a while now and no issues. It only occurred yesterday after I updated wordpress with the latest update. 

I've left it uninstalled for now so that my site can run as usual

Yep, same issue here also, currently following the instruction to delete it off from ftp, I do not know yet about re-installing but I'd hate to reinstall only to have to go thru all this to delete it again. 

I'll note here, I couldn't even get into my admin without renaming W3 Cache in my ftp first .. once I got into admin, I was then able to follow the above instruction.


Same issue here as well. The website must have run some automatic updates, just got a message today that it's crashed due to the following error:

An error of type E_ERROR was caused in line 452 of the file /xxxx/xxxx/public_html/wp-content/plugins/w3-total-cache/Cache_File.php. Error message: Illegal length modifier specified 'f' in s[np]printf call

I am unable to log in via the admin panel and will follow steps to remove the plugin and files via FTP.

I had the exact same error lisa. I'll let you know if I'm able to fix it, but for now I'll be patient and wait for a response from support.

Has anyone found an alternative solution since this happened? My page load times are terrible now, so I'm keen to reinstall this or try another plugin

Nope - I installed autoptimize on one site and that made some improvements, though ideally the two programs could run together.

Hi everyone!

So far it seems that the error is created on sites that are using PHP versions 7.2.32 and 7.3.20.  If you have the option, try upgrading to PHP 7.4 to see if that gets rid of the fatal error.  Strangely enough we were able to locate some reports of Drupal sites with a nearly identical error message and upgrading to a newer PHP version fixed the issue for them.

Flushing the cache can also fix the error and you can run the following WP CLI command to flush the cache after you SSH into your server:

wp w3-total-cache flush all

Please let us know if those troubleshooting steps help you restore access to your websites!

Yes, this did the trick for me! Upgraded my sit from PHP version 7.2 to 7.4 --> re-stalled W3 Total Cache and it no longer crashed my site. I think I exported my settings somewhere, so I will re-import them now and I should be good to go :)

Thanks for your help!

You're welcome, I am glad to hear that upgrading to PHP 7.4 fixed the issue! Hopefully this issue is limited to those 2 versions, but please let us know if you ever encounter any other problems in the future!