Skip to content

Instantly share code, notes, and snippets.

@neilgee
Created August 18, 2020 01:46
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save neilgee/808fc4f8f6e4f35ff7285c6631e02392 to your computer and use it in GitHub Desktop.
Save neilgee/808fc4f8f6e4f35ff7285c6631e02392 to your computer and use it in GitHub Desktop.
Remove Product Tags from Products in WooCommerce
<?php //<~ don't add me in
/**
* Remove Product Tags from Products Post Type - WooCommerce
* @link https://rudrastyh.com/woocommerce/remove-product-tags.html
* @author Misha Rudrastyh
*/
add_action( 'admin_menu', 'themeprefix_hide_product_tags_admin_menu', 9999 );
function themeprefix_hide_product_tags_admin_menu() {
remove_submenu_page( 'edit.php?post_type=product', 'edit-tags.php?taxonomy=product_tag&amp;post_type=product' );
}
add_action( 'admin_menu', 'themeprefix_hide_product_tags_metabox' );
function themeprefix_hide_product_tags_metabox() {
remove_meta_box( 'tagsdiv-product_tag', 'product', 'side' );
}
add_filter('manage_product_posts_columns', 'themeprefix_hide_product_tags_column', 999 );
function themeprefix_hide_product_tags_column( $product_columns ) {
unset( $product_columns['product_tag'] );
return $product_columns;
}
add_filter( 'quick_edit_show_taxonomy', 'themeprefix_hide_product_tags_quick_edit', 10, 2 );
function themeprefix_hide_product_tags_quick_edit( $show, $taxonomy_name ) {
if ( 'product_tag' == $taxonomy_name )
$show = false;
return $show;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment