public
Last active

Remove WooCommerce Generator Tag

  • Download Gist
gistfile1.php
PHP
1 2 3 4 5 6 7 8 9
function my_woocommerce_loaded_function() {
global $woocommerce;
 
// remove WC generator tag from <head>
remove_action( 'wp_head', array( $woocommerce, 'generator' ) );
}
 
// called only after woocommerce has finished loading
add_action( 'woocommerce_init', 'my_woocommerce_loaded_function' );

Good find. I was trying to hook it on wp_head. Thanks!

2.1 changes the action to

remove_action( 'wp_head', 'wc_generator_tag' );

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.