WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to store a few extra details for my custom post type, using meta boxes. Should I store all the values under one meta key in an array, or create several meta key and value pairs?

share|improve this question
Please define your "few extra details". – Chip Bennett Aug 20 '12 at 16:02
up vote 1 down vote accepted

If you want to use the values to sort or filter the data, you should keep them as separate entries.

share|improve this answer
and if not, I should use an array? Does it improve performance or have any other benefit? – drtanz Aug 20 '12 at 13:18
I don't know if it improves performance or not. – nvwd Aug 20 '12 at 13:54
ok, I'll wait for other responses then, thanks. – drtanz Aug 20 '12 at 13:57
meta data are intended to be discrete key => value pairs. You should store them as such. You gain no performance improvements by trying to force them into an array. – Chip Bennett Aug 20 '12 at 16:03
Thanks Chip, that's what I was looking for. – drtanz Aug 20 '12 at 17:12

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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