Disabling W3 Total Cache Footer Comment

The W3 Total Cache (W3TC) WordPress plugin adds an HTML comment like the one below to the page footer.


If you wish to remove it without modifying the W3TC files (which would be overwritten when the plugin is upgraded), you can add the following code to your functions.php. Note that this code uses an anonymous function, which requires PHP 5.3+.


While removing this is not necessary as it just shows in the code, it does help reduce a couple of queries to your database.