Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@Jany-M
Created July 24, 2018 14:23
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Jany-M/cc7dd788e035539df866af385975da4d to your computer and use it in GitHub Desktop.
Save Jany-M/cc7dd788e035539df866af385975da4d to your computer and use it in GitHub Desktop.
[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