Skip Navigation

[Gelöst] Any performance difference between Custom Fields and Taxonomies?

Dieser Thread wurde gelöst. Hier ist eine Beschreibung des Problems und der Lösung.

Problem: Is there a performance difference between custom fields and taxonomies?

Solution: At a very large scale, taxonomy searches may be faster because the tables are indexed. Most sites aren't large enough for these differences to become very apparent.

This support ticket is created vor 6 Jahre, 6 Monate. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 2 Antworten, has 2 Stimmen.

Last updated by julienL-5 vor 6 Jahre, 6 Monate.

Assisted by: Christian Cox.

Author
Artikel
#570239

Hello,

I am trying to decide whether to use Custom Fields or Taxonomies (Hierarchical) on CPTs and I wanted to know if there would be any difference in terms of performance when I will then use the Views plugin to display custom searches.

There are a number of pros and cons to each in my use case, but at scale, when I will display them using Views, would there be any advantage at all in using one or the other? People will be able to filter results based on them, and some views will only display items belonging to "categories". If there will be a difference in terms of performance in using Taxonomies or Custom Fields to implement "categories", then I will choose accordingly 🙂

Many thanks!

Best,
- Julien

#570268

In terms of displaying a post or a View of posts, not much of a difference.

In terms of search, in most sites you're not going to see a difference in search queries for a moderate number of posts. At a scale of many, many thousands of posts with many, many custom fields in each post, you may begin to see some performance improvements with taxonomies over custom post types when you perform searches because the postmeta table (where custom fields are stored) is not indexed. Taxonomy searches require one or two subqueries, but the tables are more aggressively indexed.

In terms of administration, I find the WordPress taxonomy interface in a post editor to be quite handy because it provides autosuggest (typeahead). Types custom field editors do not include this feature, so you must either set up a select field with many options in advance, or predefined checkboxes, or some other system to make sure you manage the possible values effectively.

I hope this helps you make the best decision for your site's needs. Let me know if I can offer any additional assistance here.

#570333

Many thanks Christian, that perfectly answers my needs 🙂

Best,
- Julien

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.