0

I wish to restrict the user posting a new article to select only 1 category for that post. It doesn't matter which category he chooses as long as he chooses just one. This way posts are maintained under a hierarchy (and I want to avoid users clicking all categories so that their posts appear everywhere).

I don't want to restrict the user to a specific category, I just want to limit the number of categories the user can choose for a post to 1.

Is there any way to achieve this in Wordpress?

  • Cleaned up. (filler text) – kaiser Oct 13 '12 at 0:54
2

I've solved this in the past for a client by using remove_meta_box to hide the default categories meta box, then adding my own meta box via add_meta_box which outputs categories as a drop-down select list, which effectively limits selection to a single item.

| improve this answer | |
  • Thanks. So I guess I could also output them as Radio buttons, and also not display Parent categories if I wish to only allow pages to be categorised with a leaf category? – jbx Oct 13 '12 at 11:48

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.