WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a custom taxonomy, and would like to force the user to select at least one term from that taxonomy when creating a post in the WordPress admin back-end. Is this possible?

share|improve this question
I forgot to mention - I'm using a drop-down field to display the taxonomy terms when creating a post. – Emzo May 23 '11 at 21:08
up vote 0 down vote accepted

No. This is not completely possible. One solution would be to swap out the default UI on /wp-admin/post.php & /wp-admin/post-new.php. You can provide the user with radio buttons or a select box. This will work relatively well, but can not be 100% trusted. There is still the possibility that a user could remove all terms via quick edit in /wp-admin/edit.php.

share|improve this answer
Hmm, not so straight-forward. Another idea I had was to use the save_post hook to check if a term had been selected, and if not, I could add a default term from the taxonomy. – Emzo May 23 '11 at 21:11
That's actually really easy to do, this snippet is a good place to start: wordpress.mfields.org/2010/… – mfields May 23 '11 at 21:50

Your Answer


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.