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

Where are custom types stored? Because when a custom type is created, in wp_posts, the post type is set to the <new_custom_post_type>. But where are the details of the new custom post type stored??

share|improve this question

The details of custom post types aren't stored anywhere, they're loaded at runtime with each request via register_post_type calls.

share|improve this answer
hmmmm, ok, thats y when I was trying to search for the info in the database, was not seeing them, thanks! – Noor Apr 19 '12 at 16:16
That is not true at all. – Bainternet Apr 19 '12 at 16:52
This may be true of the definition of the custom post type, but it does not address the question of where the data associated with each instance of a custom post type is stored. – Bob Jones Aug 18 '14 at 19:49
@BobJones the question mentions the wp_posts table, so it seems pretty clear they know where the post data is stored. but if you have a different interpretation of the question, then perhaps you should add your own answer. – Milo Aug 19 '14 at 0:54

I finally found the custom post type data. It is stored in the wp_post table where post_type = custom post type (e.g. "products"). The field (column) data is stored in wp_postmeta where the meta_key is the column name and meta_value is the column value.

This query will bring back all data associated with the custom post type "products":

SELECT P.ID, P.post_title, M.meta_key, M.meta_value
FROM wp_posts AS P
INNER JOIN wp_postmeta AS M ON M.post_id = P.ID
WHERE P.post_type = 'products' and P.post_status = 'publish'
ORDER BY post_title, meta_key
share|improve this answer

You can use the function get_post_types to get information on any and all post types that are active at that time. To get info on a specific post type, use get_post_type_object.

share|improve this answer
+1 - To make the returned post types from get_post_types only custom ones the parameter _builtin can be set to false – ialocin May 25 '15 at 17:34

WordPress default comes with some sample post types like pages, posts etc. Wordpress has given option to create our own custom post types also. Both default & custom posts are stored in single table "wp_posts" by differentiating all posts types based on "post_type" column in "wp_posts" table.

pages--> post_type="page",
testiminials--> post_type="testimonials"

To grab more information about this post_types, which would be available at "wp_postmeta " table.

share|improve this answer

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.