hide category menu from custom post type code example
Example: hide category menu from custom post type
<?php
function by_remove_menu_pages() {
remove_submenu_page( 'edit.php?post_type=testimonials-widget', 'edit-tags.php?taxonomy=category&post_type=testimonials-widget' );
remove_submenu_page( 'edit.php?post_type=testimonials-widget', 'edit-tags.php?taxonomy=post_tag&post_type=testimonials-widget' );
remove_submenu_page( 'edit.php?post_type=testimonials-widget', 'testimonialswidget_settings' );
}
add_action( 'admin_menu', 'by_remove_menu_pages', 999 );