Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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?

share|improve this question
    
Cleaned up. (filler text) –  kaiser Oct 13 '12 at 0:54

1 Answer 1

up vote 2 down vote accepted

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.

share|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

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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