0

I'm doing a re-design and re-coding of a fairly large Wordpress website. As part of it we're adding some different post types representing various data types (website will have additional data-driven pages for viewing). I'm trying to do some work to optimize the way I set up the various meta data and taxonomies in order to ensure good performance long term when we have lots of data.

Let's say I have the following post types:

  1. Articles (Posts)
  2. Events
  3. People

I have some sort of custom field or taxonomy: Team

Team will have roughly 15 options for its value. Every Article and every Event will be assigned to one team. The team options will be the same for articles, events and people.

Should team be a taxonomy? If so, am I essentially setting up a duplicate taxonomy for each post type (one for articles and one for events and one for people)?

I will definitely be querying based on the team value for all 3 post types, so I'm assuming meta data isn't ideal since the meta value is not indexed in the database. Is it a bad idea to add an index for the meta value column in that DB table?

1

Should team be a taxonomy? If so, am I essentially setting up a duplicate taxonomy for each post type (one for articles and one for events and one for people)?

You can assign the same taxonomy to multiple post types, so I don't see why you'd need to duplicate it.

I will definitely be querying based on the team value for all 3 post types, so I'm assuming meta data isn't ideal since the meta value is not indexed in the database. Is it a bad idea to add an index for the meta value column in that DB table?

Indexes tend to be left alone when the Core updates. I am speaking from experience so that is not official and there is no guarantee that that will be the case.

I don't think I understand your goal well enough to say which is best (though I probably lean toward "taxonomy"), however...

  • Taxonomy queries are complicated as there are three tables involved just for the taxonomy, and then the post tables themselves, though they are not necessarily used for all queries.
  • Meta queries are comparably much much simpler. Even without the indexes you need, it may be quicker.

My answer would be, if you really are going to have data and traffic worth worrying about the performance difference, set each up on dev stack and profile it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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