So I've been working on created a catalog based off of wordpress's metabox functionality with a custom post type, but now as it comes time to start searching the database to return specific data sets, I'm realizing that I cannot query the data that has been stored inside a metabox because it is being stored as a serialized array in the database. I have been using Dimas' metabox library (which I much appreciate) to process the metaboxes, but then realized that the data was being serialized.

I can't work with serialized data (at least I don't think I can) because I need to be able to query the database to select data sets according to the values of the metabox data.

My question is if I go with the straight building of the metaboxes, like Justin Tadlock's tutorial over at Smashing show how to do, will that data still be serialized, even if there is only one value per metabox? From everything I'm reading it seems to suggest that such is the case. If so, I'm afraid I'll have to work outside the metabox functionality, which I wouldn't even know how to begin.


1 Answer 1


As Kaiser suggested, the Metabox script available over at http://www.deluxeblogtips.com/2011/03/meta-box-script-update-v30.html propagates metadata to the database as individual entries instead of a serialized array. I suppose it is ultimately a matter of preference between how you want your data to be stored in the database. I have appreciated using Dimas'WP Alchemy plugin up until now, but now that I need to be able to query the database according the meta value, I needed to be able to access specific values directly. Rilwis'solution adds the meta data to the database as individual entries (non-serialized) which is what I needed.

Thanks Kaiser.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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