This was hacked together very quickly. I don’t for sure if there will be problems with translation, but I be there would be.
function remove_menu_from_cpt() {
global $submenu;
$post_type="book";
$tax_slug = 'post_tag';
if (isset($submenu['edit.php?post_type=".$post_type])) {
foreach ($submenu["edit.php?post_type=".$post_type] as $k => $sub) {
if (false !== strpos($sub[2],$tax_slug)) {
unset($submenu["edit.php?post_type=".$post_type][$k]);
}
}
}
}
add_action("admin_menu','remove_menu_from_cpt');
It used the ‘book’ post type and post tags, because that was convenient for me to test, but it pretty obvious what needs to change to make this work for your case– I believe you need:
$post_type="my_custom_post_type_name";
$tax_slug = 'category';
Related Posts:
- Restrict custom post type to only site administrator role
- Prevent pre_get_posts filter on specific post type
- How to force one column layout on custom post type edit page?
- Multiple post types – share same ReWrite slug?
- How to change “Draft” string for status of custom post type to “Unavailable”?
- Search multiple custom fields by using meta_query
- How to Remove Certain Screen Options and Table Columns from post type in wp_list_table?
- How does one delete orphan custom post type?
- Redirect after deleting post and keep track of pagination
- Add comments meta fields to comments metabox on post edit screen
- Custom Post Type with Custom Title
- Search results ordered by custom post types are not grouped
- How can I customize “Pages” admin (edit.php) and “Edit Page” admin (post.php) for bulk edit of custom content type?
- Custom Post Type by user
- saving custom post type data to different table in wordpress
- Query post types with multiple keys
- Interesting Custom Post Type Slug with Taxonomy and Custom Field
- Remove POST_TYPE from custom post type permalink
- same archive template for different custom post
- Custom Post Type post ordering not working
- How do you output custom code between posts in the loop?
- Best practice for adding posts in bulk
- WP 3.1 getting tax_query to work in query_posts()
- wp_get_nav_menu_items wp-admin/customize.php problem
- Impossible to get Attachments Outside WordPress?
- How does the $post_type global variable work?
- Assigning the same custom meta box to multiple post types
- Delete link on single-custom.php with redirection
- How to structure a site with product variations pages?
- Getting rid of /my_custom_post_type/ in the single view URL
- Custom Post Type – List all attachments on Edit Screen
- Custom Page that comes with preloaded content for the user
- How to customize a permalink (URL) structure?
- will post_id ever change? Can I safely use post_id for custom queries?
- Is it possible to create relational metabox values in a custom post?
- Custom Post Type Query for Sidebar Doesn’t Work on Front Page
- Meta query for custom post type ignored in main query
- How do I move/order posts with a tag to the end?
- Use same slug base for Custom Post Type posts, and multiple taxonomy terms
- Custom Path/Folder behind a custom post type
- Update postmeta Parent when post_status child change
- WP_Query custom post type query not showing the exact post type
- How to Get WordPress custom post data in WooCommerce product meta panel? [closed]
- Send notification to the admin when new custom post is submitted
- How do i search authors from search form using author’s name
- How to produce a sub-page-system in WordPress
- don’t publish custom post type post if a meta data field isn’t valid
- How do you make a custom post type items automatically delete items 3 months after publication?
- custom post data – how to
- How to display custom field value on page?
- Add an Outside Wrapper to my Header and Make it Full Width
- WordPress custom API endpoint – how to make the request more flexible
- Add custom columns in custom post type browse page
- Create custom WP_List_Table in post_type
- How to hide a custom field from admin?
- Get terms for a specfic post from multiple taxonomies in custom post type
- CMB select with data from CPT
- cannot achieve this structure (custom posts VS categories VS ??)
- Is it possible to have hierarchical taxonomy and hierarchical custom post types in one permalink?
- how to use custom post types collectively integrated with each other
- Why doesnt my tag page populate with this custom post type?
- Home page is getting current-menu-item even if it’s not home
- Problem with customize page cached in WordPress.com [closed]
- Multiple categories assigned to a single product breaking the breadcrumb
- Adding a location field to buddypress activity
- Create API’s for custom-post types & custom queries using REST or Graphql
- custom post type and user post count shortcode
- How can I assign multiple parents to CPT?
- Getting 404 on child page with pre_get_posts() on custom posts
- CPT: multiple loops with different terms
- Stored meta from attachment, video length?
- Limit posts per page depending on the size of a div?
- Delete Post by User
- save_post affect creation and deletion
- Set a static page as a user profile page?
- Problem to get the link of the default ‘post’ post type like the orther custom types
- WordPress query posts by custom post type not workng
- How to display all custom fields associated with a post type – IN THE ADMIN AREA?
- How to keep a CPT stick to specific position?
- Static front page has page url not site url
- WP_Query for CPT with filter by another WP_Query
- Using get_terms() as shortcode attribute
- Turn post into simple slideshow
- Problems with a custom meta_box
- Multiple Block Quotes without using HTML
- How to apply order on custom taxonomy and custom meta key on custom post type
- How can i display on front page a movie that is atached in a post type
- Data won’t save on a straightforward metabox, what am I missing?
- Custom post type functions.php if statement on action
- Query multiple post of which one by taxonomy
- How to make a template for a specific post of a custom post type?
- Bulk update custom post types
- Set a Custom Post Type as a Homepage
- Slideshow/Gallery plugin based on WP Core Gallery [closed]
- How to create a job post by email parsing? [closed]
- ACF select box css color change
- Creating post custom field text area
- Delete old thumbnail when updating new
- How to automate the creation of advanced layout article/post
- Sort CPT by taxonomy AND THEN by custom field