Remove WooCommerce Generator Tag

If you would like to remove the Remove WooCommerce Generator Tag from the <head> section of your WordPress installation, you can add the following line somewhere, perhaps in your wordpress functions.php file:

remove_action('wp_head', array($GLOBALS['woocommerce'],'generator'));

I’ve updated the code to work with the most recent version of Woo Commerce, try adding this to the functions.php file of your WordPress theme:

function remove_woo_commerce_generator_tag()
{
    remove_action('wp_head',array($GLOBALS['woocommerce'], 'generator'));
}
add_action('get_header','remove_woo_commerce_generator_tag');

That will prevent the following line from being shown in your HTML code:

<!-- WooCommerce Version -->
<meta name="generator" content="WooCommerce 1.5" />

Remove WooCommerce Generator Tag

Related Posts:

  • No Related Posts
This entry was posted in Security, Tech Tips, Web Development and tagged , , , , . Bookmark the permalink.

8 Responses to Remove WooCommerce Generator Tag

  1. Euryko says:

    For WooCommerce 2.1 and above, use this:

    function remove_woo_commerce_generator_tag() { remove_action('wp_head','wc_generator_tag'); } add_action('get_header','remove_woo_commerce_generator_tag');

  2. Johndoe says:

    Thanks, works Woo 2.0.20 // WP 3.8

  3. Unglood says:

    Thank you very much. Appreciated. Works on Woo 2.0.13

    @Henry – thank you too. Works on WP 3.6

  4. Anderson says:

    Thanks! 2.0.3 Work

  5. Henry says:

    Nice solution. Similarly you can remove the WP generator tag using:

    remove_action(‘wp_head’, ‘wp_generator’);

  6. Skywalker says:

    Works on 1.6.1. Thanks!

  7. W says:

    Thanks for letting me know. I’ve updated the code.

  8. Caroline says:

    Not working for WooCommerce 1.5.4, but thanks anyway!

Leave a Reply

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