How to remove button Add New Category (editor-post-taxonomies) in post editor

Viewed 42

Add New Category - how to remove this link?

Add New Category - how to remove this link?

When creating a taxonomy, I use the default_term argument, so I no longer need the functionality to create and edit taxonomies, I only need the ability to select from those taxonomies that I created using default_term.

Removed from the menu - show_in_menu set to false. But I don't understand how to remove this link when creating a taxonomy?

Help remove the ability to edit in the post editor.

1 Answers

The following CSS selector can be used to target and hide the "Add New Category" button:

.components-button.editor-post-taxonomies__hierarchical-terms-add{
    display: none;
}

It's also possible to create your own Custom Taxonomy Selector component to replace the existing UI using JavaScript; as you need only to hide the button, I would use CSS in this case.

Related