I am creating a plugin that is using custom post types to store custom data. I need to store additional information for each item, and was wondering witch is better for storing my custom information taxonomy or post meta.
The custom information is:
2. a few sets of text values selected from predefined options, some of witch are
My question is, witch of these approaches makes more sense structurally, and with witch one will the load on the database be lighter when pulling up to 30 items per page?
Can’t help on query efficiency, but as a general rule, use of a taxonomy is probably preferable in circumstances where the taxonomy “terms” will be present multiple times (this seems to be the case for both #1 and #2 in your example).
For instance; if your custom post_types all have “measurements” (a “key” in terms of post meta), but the “value” of those measurements are all (or mostly) unique, using post meta would be more logical. Alternatively, if the “values” are recurring, using custom taxonomies would give you more flexibility within WordPress.
To analogize; “key” is to “taxonomy” as “value” is to “term”, for post meta and custom taxonomies, respectively.
Using taxonomies also provides you with some nifty native WP functions.
Viewing 1 replies (of 1 total)
The topic ‘Taxonomy or post meta?’ is closed to new replies.