Consider a busy site with about 10,000 posts divided in 10 custom post types.
Custom taxonomies and custom fields are also used on all of them.
The main query was modified to include all these posts types everywhere, on index, archives, search, feeds.
Now, is there any performance hit caused by using custom post types versus regular ‘post’? Or it wouldn’t make a difference what types they are?
4 Answers
No. All posts are stored in the wp_posts
table. The post type is defined by post_type
column.
Regardless to custom post types included in query, there is only one SQL query executed. Of course there may be some performance hit caused by a little bit more complex query (in vs. =), but it’s marginal.