Custom Taxonomy as “Post Meta”

I found this post while sorting through my old drafts and decided to go ahead and publish it rather than trashing it. Hopefully the code samples don’t break too badly in WordPress 3.9.

I’ve talked a bit about when to use custom taxonomies and when to use custom fields/post meta (and how they can be used virtually interchangeably in some situations). If you want to use taxonomies, you’ll probably also want to:

  • make sure that the terms you want to use exist in your custom taxonomy
  • limit the ability for these terms to be altered

This Gist is a good start:

You’ll probably also want to specify:

'public' => false,
'show_ui' => true,

when defining your custom taxonomy. This makes the UI box for the taxonomy appear in the post/page editing interface as expected, but hides the admin forms for editing the taxonomy terms from the admin menu.