WordPress Custom Post Type names restricted to max 20 characters

Ever spotted this error:

: register_post_type was called
. Post type names must be between 1 and 20 characters in length. Please see
Debugging in WordPress
for more information. (This message was added in version 4.2.) in
on line

Thrown here:


	if ( empty( $post_type ) || strlen( $post_type ) > 20 ) {
		_doing_it_wrong( __FUNCTION__, __( 'Post type names must be between 1 and 20 characters in length.' ), '4.2' );
		return new WP_Error( 'post_type_length_invalid', __( 'Post type names must be between 1 and 20 characters in length.' ) );

So It would appear that due to legacy issues, your custom post type cannot exceed 20 characters.

What are these “legacy issues” I speak of? The post_type field in the wp_posts table in the database where the type of post (your custom post type’s name) is saved, is a VARCHAR(20)!

Screen Shot 07-06-16 at 08.58 AM

I have no words.

Your word should be your bond

As a kid, you learn about promises, and how you’re meant to keep your promises. You always end up breaking them anyway somewhere along the line. Some would say that promises are meant to be broken.

I don’t believe in promises, I believe that when you tell someone you’re going to do something, you should do it. I believe that your honour and reputation is at stake every time you break your word.

It’s happened a million times that I’m waiting for an important e-mail, that I was promised, but just never comes.

I consider not being punctual as breaking your word. If we agreed on meeting at a certain time, and you’re late, you’re breaking your word.

How about my screwdriver you borrowed last week. “I’ll bring it right back, after I’m done”. Yeah right. You broke your word.

Call me old fashioned, but I still believe that your word should be your bond.