Skip Navigation

[Gelöst] Whether to use taxonomy or checkboxes custom fields

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

Problem:
Are there performance reasons to choose taxonomy checkboxes vs a checkboxes custom field?

Solution:
In general taxonomies are more performant than custom fields when it comes to querying posts. Taxonomies are stored in custom tables optimised for the purpose, while custom fields are stored in the general purpose wp_postmeta table. On smaller sites the difference would be too small to notice, on larger sites with more traffic the difference might be noticeable.

Relevant Documentation:
http://ottopress.com/2011/when-to-not-use-a-custom-taxonomy/
https://tomjn.com/2017/02/27/not-post-meta-bad/

This support ticket is created vor 6 Jahre, 4 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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+01:00)

This topic contains 1 Antwort, has 2 Stimmen.

Last updated by Nigel vor 6 Jahre, 4 Monate.

Assisted by: Nigel.

Author
Artikel
#602478

Jay

I was wondering if anything has changed in the new Types beta regarding checkboxes being saved as serialized arrays? Last I read, it was only checkboxes and skype fields that were serialized.

Regarding checkboxes specifically, I was wondering about filtering custom field checkboxes vs taxonomy checkboxes. Is there a difference in performance vs flexibility? This area is very unclear to me still.

I have read some posts on here suggesting that if you were to need checkboxes, it might be best to store them as tax terms rather than custom fields. Why would this be?

#602513

Nigel
Supporter

Languages: Englisch (English ) Spanisch (Español )

Timezone: Europe/London (GMT+01:00)

Hi Jay

Nothing has changed with how Types custom fields are stored in the beta, so, yes, checkboxes fields are stored as a serialised array.

I'm not sure what you have read, but in general taxonomies are more performant than custom fields when it comes to querying posts. Taxonomies are stored in custom tables optimised for the purpose, while custom fields are stored in the general purpose wp_postmeta table. On smaller sites the difference would be too small to notice, on larger sites with more traffic the difference might be noticeable.

You might find these couple of articles helpful in deciding whether to use taxonomies or custom fields for your particular use:

hidden link
hidden link

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