2

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?

  • without knowing the specifics (at least the code you use) and the distribution of the posts between the post types, it is hard to estimate the impact. – Mark Kaplun Mar 8 '18 at 6:06
2

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.

3

No, there is no meaningful performance difference.

  • They're all stored the same way internally
  • They're all queried the same way

Every query is a post type query, if you don't specify which ones, it'll use post, the built in post types have no special performance advantage over custom post types, and the post type column is indexed for performance

2

There is no difference, the CPT is stored in the same wp_posts table as "normal" posts - as mentioned by most answers here - however, I would also add that where performance can be impacted is if you store a lot of postmeta (custom fields) so - for best performance - try not to store "lots" in postmeta - so use custom taxonomies where at all possible!

  • I learned that the hard way, using custom taxonomies whenever the data isn't post specific. – Michael Rogers Mar 19 '18 at 22:06
0

I've handled sites with 400,000 - 500,000 posts and they work fine .. 10,000 posts is nothing for WordPress to handle regardless of the usage of custom taxonomies & custom fields.

WordPress has a very mature architecture to handle post meta data and the built-in functions and procedures are quite good enough to handle loads of data.

The first thing you need to know that WordPress stores page, post & <custom-post-types> alike, they're stored in wp_post table and the post_type fields differentiates them; the meta data is stored in wp_postmeta table each custom field is identified by meta_key and linked to the post by post_id field!

The only performance issue is the way you retrieve them, optimizing your custom query to the max is the solution to your performance issues!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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