Instantly share code, notes, and snippets.

Embed
What would you like to do?
[WP][WC] Remove / Hide WooCommerce product tags, the right way
<?php
// Overwrite product_tag taxonomy properties
add_action('init', function() {
register_taxonomy('product_tag', 'product', [
//'public' => false, // making it not public could throw errors in some themes / plugins
'show_ui' => false,
'show_admin_column' => false,
'show_in_nav_menus' => false,
'show_tagcloud' => false,
]);
}, 100);
// Remove the column from Products list
add_action( 'admin_init' , function() {
add_filter('manage_product_posts_columns', function($columns) {
unset($columns['product_tag']);
return $columns;
}, 100);
});
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment