2

Is anyone aware of a plugin that disables categories in WP?

By this, I mean completely hiding the feature from view automatically, for existing and new users alike. In particular:

  • the WP admin menu
  • the posts list, its screen options, and its filters
  • the post editor and its screen options
  • the widgets screen
  • the writing and permalink settings screens

I've run into a variety of aging hacks to do part of this, namely and mostly code to disable meta boxes and a handful of plugin to disable the permalink prefix. I'm turning to SO in the hopes that some web designer or developer might have the entire set of features on hand.

If not, might there be new APIs from the past 3-4 years that make the process simpler (my WP skills are getting rusty), or is seeing it through going to be an awkward output buffer manipulation-related hack?

7

With most credit due to this stackexchange answer:

function wpse120418_unregister_categories() {
    register_taxonomy( 'category', array() );
}
add_action( 'init', 'wpse120418_unregister_categories' );

This technically leaves everything in place (so you could bring it back at any time without a loss of data), but it "unhooks" it from everywhere in the admin by removing it from all $object_types.


UPDATE

And to get rid of the Widget, add this to the function above.

unregister_widget( 'WP_Widget_Categories' );
  • 1
    +1 - Very nice. I wasn't aware of that new API. :-) Not accepting it immediately because I'm still seeing stuff over in the Settings / Writing and Settings / Permalinks pages, but it's very, very close. – Denis de Bernardy Oct 28 '13 at 22:34
  • OK… Further investigation yields that the rest needs some output buffer manipulation. Thanks a lot! (PS: Any odds you've a similar trick for my similar question for comments?) – Denis de Bernardy Oct 28 '13 at 22:39
  • Comments would be a new question :) Post away if you like. You're right that this won't take care of the setting, I'd probably just CSS-it out. Updating answer to include getting rid of widget. – mrwweb Oct 29 '13 at 4:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.