Skip Navigation

[Résolu] Whether to use taxonomy or checkboxes custom fields

Ce fil est résolu. Voici une description du problème et la solution proposée.

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 Il y a 6 années et 4 mois. 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.

Aucun de nos assistants n'est disponible aujourd'hui sur le forum Jeu d'outils. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.

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)

Marqué : 

Ce sujet contient 1 réponse, a 2 voix.

Dernière mise à jour par Nigel Il y a 6 années et 4 mois.

Assisté par: Nigel.

Auteur
Publications
#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

Les langues: Anglais (English ) Espagnol (Español )

Fuseau horaire: 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:

lien caché
lien caché

Ce ticket est maintenant fermé. Si vous êtes un client de Toolset et que vous avez besoin d'aide, veuillez ouvrir un nouveau ticket d'assistance