WordPress Custom Post Type: Performance Considerations & Implications
In addition to the normal post type which we all are conversant with, most are familiar with WordPress custom post type.
One question we often see with regards to WordPress custom post type borders around the issue of performance considerations.
So let’s say you have a busy WordPress website or blog with tens of thousands of custom post types. Not only are you using the WordPress custom post type, you’re also using custom taxonomies and custom field thus making matters a little complex.
Then also, your SQL queries includes all the different custom post types everywhere – on your feeds, archives, indexes, search, etc.
So therefore, the question is what will be the performance challenges of such WordPress custom post type implementations versus using the normal post?
WordPress Custom Post Type – Any Performance Hit?
Our research and findings indicate that there isn’t much difference in performance between using the WordPress custom post type versus using the regular post.
In fact, it may interest you to know that all WordPress posts are stored in the wp_posts_table – whether custom post type or regular post.
Although you may expect some performance degradation as a result of the little complexity in the resulting SQL query; but you’ll be surprise to learn that such performance hit is very small and near irrelevant (case depending!).
Regardless, it’s worth noting that WordPress uses the same approach in storing page, posts as well as custom post types. They are all stored in the wp_posts_table and the post_type_field is there differentiator.
Furthermore, the post_type_field is indexed for performance. As such there is no significant performance difference between WordPress custom post type and regular posts. Both are stored the same way in the database as explained above and SQL queries on both are basically the same.
And if your WordPress site is so large that you experience performance issues; this can be comfortably resolved by maximizing the optimizations made your custom query.
Nevertheless, WordPress is a tested and proven content management system. There are sites out there built on WordPress with millions of posts. And guess what – they work well even with WordPress custom post type.