W3 Total Cache hide debug info

W3 Total Cache plugin for WordPress does a great job but did you notice that it display a debug info at the bottom of your pages? Check the page source of your blog, scroll to bottom and there it is between HTML comment tags. Maybe you want to hide this message, here is how to do it.

Add these couple of PHP lines of code into your current theme function.php file:

function disable_w3tc_print_comment($w3tc_setting) { return false; }
add_filter('w3tc_can_print_comment', 'disable_w3tc_print_comment', 10, 1);

Save it and reload your page, notice that the debug info disappeared 🙂