Updates, Tips & Tricks

Updates as Released, Plus My Personal Collection Of WordPress Best Practices

How to Remove the WooCommerce Generator

28 March

On many of the sites I build, customers want clean HTML and as close to obfuscation for the platform as possible. That inevitably means removing various plugin generators. One in particular that’s tricky is WooCommerce due to the way it’s added with the global $woocommerce variable. To accomplish this feat, add the following to your functions.php file:

// Remove WooCommerce Generator
add_action('woocommerce_init','remove_woocommerce_generator');
function remove_woocommerce_generator() {
    global $woocommerce;
    remove_action( 'wp_head', array( $woocommerce, 'generator' ) );
}
No comments yet.

Leave a Reply