Make WordPress Core

Opened 8 years ago

Closed 5 years ago

Last modified 5 years ago

#37104 closed enhancement (maybelater)

increase post_type field length from varchar(20) to varchar(100)

Reported by: ajwah's profile ajwah Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.5.2
Component: Posts, Post Types Keywords:
Focuses: Cc:

Description

I complained about this issue here: https://wordpress.org/support/topic/why-should-post-type-names-be-between-1-and-20-characters-in-length?replies=1#post-8523345

Someone provided this history:
https://ticket2604.wordpress.com/2016/06/13/why-post-type-name-is-limited-to-20-character/

which is indicative to the fact that there should be no reason to restrict the length of post_type etc. to only 20 characters.
If you want to cut straight to the chase, then read this:
https://core.trac.wordpress.org/ticket/2604#comment:5

Change History (6)

#1 @SergeyBiryukov
8 years ago

  • Component changed from General to Posts, Post Types
  • Summary changed from varchar(20) should be replaced with varchar(100) to post_type varchar(20) should be replaced with varchar(100)

#2 @dd32
8 years ago

  • Summary changed from post_type varchar(20) should be replaced with varchar(100) to increase post_type field length from varchar(20) to varchar(100)

I'll copy a reply from #39507 to here for future discussion:

Worth noting that comment_type and post_type are both VARCHAR(20) while taxonomy is VARCHAR(32).

I'm not sure I see benefit in these fields being longer, they're designed as a short unique grouping of objects.

#3 @Howdy_McGee
5 years ago

  • Resolution set to maybelater
  • Status changed from new to closed

Since it's been a few years since this has last been updated and the stance hasn't changed this can probably be labelled as wontfix or maybelater.

#4 @desrosj
5 years ago

  • Milestone Awaiting Review deleted

#5 @ocean90
5 years ago

#50265 was marked as a duplicate.

#6 @ninetyninew
5 years ago

Agree with the original poster on this. I've had to make an exception just for post types to my own naming conventions due to this - there are scenarios where you wish to use a unique prefix for a post type to avoid clashes but can't then give the post type a descriptive enough name due to the limit.

Note: See TracTickets for help on using tickets.