- How To Remove W3 Total Cache Comment FooterBy guru on August 4, 2011 | No Comments
W3 Total Cache is one of the best caching plugin in WordPress which improve the blog performance load. Most of the webmaster see their Google Page Speed ranking improve after plugin activation.
Even after we activate the W3 Total Cache plugin, one of the Google Page Speed recommendation is to Minify HTML.
Quite strange because W3 Total Cache should minify the HTML as part of the optimization feature.
When I right click and View Source for the HTML code, I found that there’s comment inserted by W3 Total Cache itself to display the cache performance details.
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/ --> Minified using disk Page Caching using disk (enhanced) Database Caching 12/15 queries in 0.009 seconds using disk Object Caching 437/473 objects using disk Served from: www.allguru.net @ 2011-08-02 18:48:14 -->
Looks like this part of HTML wasn’t minify by W3 Total Cache so I take the chance to remove it.
The W3 Total Cache comment footer is generated by the ob_callback function which resides in …/wp-content/plugins/w3-total-cache/lib/W3/Plugin/TotalCache.php
Before: if ($this->can_ob()) { ob_start(array( &$this, 'ob_callback' )); } After: if ($this->can_ob()) { /*ob_start(array( &$this, 'ob_callback' ));*/ } Note: The remark on the ob_callback function code will remove the comment footer.
Clear the cache in W3 Total Cache after the changes. Run the Google Page Speed again and you will see the Minify HTML recommendation is no longer there. Voila!



