I am creating a web application and I am using Wordpress as the back-end to take care of the database. Wordpress has all the functions I require. This is not related to blogging or posting posts.

Does anyone know of any solution to create a custom table per custom post type?

This is important. The post types will be storing very large documents and objects, usually word, xml and php objects. There will be lots of entries since the app will be used by hundreds of users so I want to keep it separate. I want other features like post meta, tags and taxonomies to be available as well.

I will keep it short. I have searched Google for a solution but developers seem to provide different workarounds. Can't I hook/filter wordpress with a plugin so that each time a custom post type is actived/queried a different table name is used. I am sure this is possible.

1 Answer 1


I am not 100%, or even 83%, sure what you are asking. The project seems complex and a lot a specifics are missing from the question. However,

  1. I am fairly sure that you don't need to duplicate the entire post table or post type set of tables.
  2. I am also not even sure if you need a custom table at all. The postmeta table performs very well depending on the query.
  3. If you do end up needing a custom table, just create a table to hold the particular "Extra" bits of information that you need and merge that information into your queries where necessary.

If you try to do what I think you are thinking about doing, you are going to be hooking into many, many hooks-- dozens maybe. It is going to be complicated and difficult to maintain.

Without more information, that is all I've got.

  • Hi, The application is an Admin app with all the usual features like add, edit and delete (that's all). There will be a lot of data to store that I have decided to store it within objects or xml and then store it in a table (longtext field). All post types will be stored in xml/objects because there is a lot of hierarchical TEXT data. Lots of tags, fields and custom taxonomy. So you can imagine the tables sizes will grow very large quickly not just in row count but storage as well. I want to take advantage of wordpress posttype functions. If it is dozens of hooks I will avoid it thanks. Oct 23, 2014 at 17:12

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.