I am creating some event functionality for my wordpress site.

Each event will have a set of tickets associated with it.

A user who is purchased at least one ticket will additionally have a set of bookings associated with it.

My question: would it make sense to store the tickets in the post meta (an event is a custom post type) and the bookings in user meta? Or should I create a few more tables in the database? Are there any good resources about the caveats of creating new tables in a wordpress install?

1 Answer 1


While you might not be writing a plugin specifically, this resource will still be pertinent: http://codex.wordpress.org/Writing_a_Plugin#Plugin_Development_Suggestions

From the codex

Use the existing database tables instead of creating new custom tables if possible. Most use-cases can be accomplished with custom post types and meta data, custom taxonomy and/or one of the other standard tables and using the standard tables provides a lot of UI and other functionality "for free." Think very carefully before adding a table because it adds complexity to your plugin that many users and site builders prefer to avoid.

While sometimes it's unavoidable to use extra database tables (like an e-commerce plugin for example), it should be avoided if at all possible. Thousands and thousands of hours from very talented developers have gone into writing and refining WordPress and the functions you get to interact with the default tables, which will certainly be more efficient than anything you (or I) could write.

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.