How To Stop W3TC From Printing HTML Comments

WpFASTER Code 0 Comments

W3TC will insert HTML comments to the bottom of your site’s source code. This is a potential security issue and is recommended that you remove them. To do so, copy and paste the following code snippet as plain text to the bottom of your theme’s functions.php file; or, add it using the Code Snippets plugin:

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

Leave a Reply

Your email address will not be published. Required fields are marked *