Remove WooCommerce generator tag in WordPress

I recently needed to remove the WooCommerce generator tag that is automatically added to the header in the source code. In this case, I was using Bones theme for WordPress. Below is the code that we want removed, as shown when you view the page source.

Woocommerce generator source code

You will need to open your WordPress theme’s functions.php file, or if your using Bones, open the bones.php file (located at /wp-content/themes/YOUR_BONES_THEME_NAME/library/bones.php, around line 107).

The code we are going to use to remove this from our source code is…

//remove WooCommere generator tag
 function remove_woocommerce_tag() {
 remove_action('wp_head',array($GLOBALS['woocommerce'], 'generator'));

Ive tested this code and it is working in WooCommerce 1.6.

Leave a Response

* Name, Email, Comment are Required