ThemeShaper Forums » Thematic


Custom Taxonomy versus Post Meta for "featured" status

(4 posts)
  • Started 11 years ago by helgatheviking
  • Latest reply from middlesister
  • This topic is not a support question
  1. so this isn't a thematic-related question but i'm wondering if anyone has any opinions on using a custom taxonomy versus post meta for a mutually exclusive categorization such as "status" where I want to restrict the possibilities to 1 of 3 choices: featured, normal and excluded.

    i've got it completely worked out w/ a taxonomy, hiding the UI, and replacing it w/ a metabox. i'm just wondering if post meta would be a better option, it probably would have been simpler. now we can query posts by both, so is there any performance difference between the two query types?

    Posted 11 years ago #
  2. middlesister

    I started writing an answer where I said I didn't think there was a difference and that I would go for the postmeta, but then I remembered an article by otto that explained when to use what.

    Basically, use taxonomies when you want to group posts in logical categories and postmeta for unique things for the individual posts. You can only use order by with postmeta, but in turn the taxonomy is loads faster to query.

    So I guess there you have it: you are grouping your posts in logical groups and it is faster to query. Use the taxonomy. :-)

    Posted 11 years ago #
  3. thanks! wouldn't you know that is the exact same post i read earlier. agreed.. taxonomy it is. also pleased b/c that means i managed to choose correctly way back when i started writing the code for this and didn't know why i was picking the option that seemed more complicated. hoorah.

    Posted 11 years ago #
  4. middlesister

    Yea, it starts me thinking too. I have an experiment single page theme going on that uses postmeta to indicate which pages should be sections of the single page. Maybe I should switch that to use custom taxonomies instead.

    I was tinkering with adding the postmeta checkbox to the quickedit dialog, but I guess it ought to be no problem using a custom taxonomy there as well. I thought the postmeta way was simpler and using taxonomy would be a bit of jumping through hoops, but it is good to know that it does make a performance difference. You can make better choices down the road.

    Just out of curiosity, how did you do it? Make the taxonomy hidden and use the metabox for a radio select button? And when the user changes the selection, remove the old taxonomy term and add the new?

    Posted 11 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.