WordPress Fatal error: Unknown: Cannot use output buffering in output buffering display handlers in Unknown on line 0

How I’ve beat the php mysterious fatal error unknown in Wordpress caused by caching plugin WP Fastest Cache

November 7, 2019

This problem was caused by WP Fastest Cache plugin the famous cache plugin with over 1 million active installations. Disabling all the options and testing one by one I’ve found that the problem happens when I flag one of these options:

  • Minify Css
  • Combine css files
  • Combined js files
list of the options of the wp fastest cache plugin

These options are critical in caching plugins because they do complex and potentially dangerous operations that modify the CSS files and Javascript files shrinking them. The minification process opens the CSS and reduce it to the minimal code necessary. This means that the code is cleaned from comments, cleaned from useless spaces, “;” chars, tabs, new lines… For javascript minification the reduction is even more heavy because it changes also the names of the functions to reduce even more (the result is normally not easy to read by a human).

All the CSS reduced files (minified is the correct term) are then chained into a one single file to reduce the number of HTTP calls. The same is made by combining the Javascript minified files and making just one JS file.

This work is really awesome and very useful. But…

It may happen that the minification process brakes everything and causes the mysterious error: Fatal error: Unknown: Cannot use output buffering in output buffering display handlers in Unknown on line 0.

These options normally works really fine, I’ve uses WP Fastest Cache plugin on many WordPress installations, I trust their developers!

I’ve found that the problem is within the script inclusion, I use inclusion directly in the footer.php or in header.php of my themes, like these:

<script type="text/javascript" data-src="<?php

And the problem happened due to the “/” chars in the version parameter (I sometimes put the date as version parameter). Removing the “/” solved the issue.

I don’t know if someone else ever found this problem.


I'm a software engineer, an everyday web developer and a maker. I usually build sites with PHP, within or without WordPress. I build Internet of Things with Arduino and ESP8266. I'm the founder of Rockit.it and Dailybest.it and I'm actually the Chief Technical Officer of Better Days web agency.


Fix for WP SUPER CACHE home not refreshing

WP SUPER CACHE is one of the most used WordPress plugin for cache, but probably there is a small bug…

December 1, 2014

W3tc plugin feed problem

When your WordPress site has a great number of requests it could happen that your server can’t handle all the…

October 22, 2012

Modify the language attribute based on category in WordPress

How to modify the language attribute in your Wordpress theme using a specific value

November 7, 2019

WP doesn’t send email? try this

Snippets for sending emails with Wordpress

February 8, 2020

Two post types share the same taxonomy in WordPress

Sharing a WordPress taxonomy between two post types is useful especially if you want to create a relation between different…

November 14, 2019

WordPress Gutenberg doesn’t parse Istagram oembed url

Sometimes Instagram embed doesn't work, why?

November 4, 2019