最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Custom post type and custom taxonomy key lenght & query performance

programmeradmin3浏览0评论

I'm creating new custom post types and taxonomies for my client and I wanted to prefix their keys so there is no conflict with any plugin that could be installed that would be providing it's own CPT and taxonomies.

At first, I set the prefix to be 3-letter long with an underscore: xyz_ (it's more unique than that and I checked google - there are no conflicts). However, I started thinking of increasing the length of the prefix to make it even more unique to up to 7 characters, like xyzabcd_ (again, just a sample).

However, I'm not sure how such change would impact the WP_Query that loops posts by the post_type column since the value would be longer for my custom post types. The same thing goes for taxonomies... I know that the db column holding that data is a varchar(30) but the actual value stored there would be longer.

Should I be worried about the performance difference here?

Thanks!

I'm creating new custom post types and taxonomies for my client and I wanted to prefix their keys so there is no conflict with any plugin that could be installed that would be providing it's own CPT and taxonomies.

At first, I set the prefix to be 3-letter long with an underscore: xyz_ (it's more unique than that and I checked google - there are no conflicts). However, I started thinking of increasing the length of the prefix to make it even more unique to up to 7 characters, like xyzabcd_ (again, just a sample).

However, I'm not sure how such change would impact the WP_Query that loops posts by the post_type column since the value would be longer for my custom post types. The same thing goes for taxonomies... I know that the db column holding that data is a varchar(30) but the actual value stored there would be longer.

Should I be worried about the performance difference here?

Thanks!

Share Improve this question asked Apr 21, 2020 at 10:21 FilipeFilipe 1
Add a comment  | 

1 Answer 1

Reset to default 0

I'm not sure about the sort of precise figures a performance/algorithm researcher would be looking for.

However, in terms of actual performance there is no difference. The WP database can take a beating and I've done plugins with dozens and dozens of filters and hooks and queries and they still run very very fast.

Furthermore, WP is not known for its speed. It's a great CMS, but cutting-edge performance/speed is not its strength. So I think there's no point in worrying about something as minor as post type length.

发布评论

评论列表(0)

  1. 暂无评论