Hide categories in gutenberg backend for custom post-type, but keep functionality.

[ad_1]

Hello, I am trying to hide the categories meta filed in the backend for a certain custom post-type.

Reason is, all the posts in this post-type are related to posts in another post-type, and inherited the categories from them. So the post-type where it needs to be hidden in the backend, still needs the functionality, the users just shouldn’t see the meta-box in the backend.

It was necessary to do it like this for some technical reasons i can’t get into here.

It seems a bit hacky to hide it with JS or CSS. The meta field doesn’t even have a proper class to target. No problem with JS, but still not my prefered way. Hiding the taxonomy in the gutenberg presets, will hide it for all the post types and users could change it back.

What is the right way to do this? I am at a loss.

Thank you!

[ad_2]

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer