Custom Post Types Are Not Posts

This confuses the heck out of a lot of people. Custom Post Types are’t posts they are post types.

Otto wrote a very nice primer on WordPress 3.0 and CPTs which points this out. Nearly a year later, people are still getting it wrong becuase they refuse to let go of the word ‘post.’ It was, in retrospect, probably a poor choice of names. Ditto Post Formats, in my opinion, but there we are.

I blame the naming, really. “Custom Post Types” makes the implication that these are “Posts”. They’re not. “Post Type” is really referring to the internal structure of WordPress. See, all the main content in WordPress is stored in a table called “wp_posts”. It has a post_type column, and until now, that column has had two main values in it: “post” and “page”.

So now, with CPTs, we can make new ‘post types’ and name them whatever we want. It’s very important to note that the column name of post_type is why we call these Custom “Post Types.” If you can let go of the (very logical) connection of ‘Custom Post Type is a type of post’ and start thinking of it as ‘Custom Post Type is a new Post Type’ then you’re halfway to victory.

If you’ve ever used a Wiki, there is no real post hierarchy like there is with a default WordPress installation. In WordPress, you always have the ability to frame your post URL slugs with date, or even category 1, as it happens. Look at MediaWiki. Everything is pretty much top-level. You don’t sort by subfolders, or categories, or anything. All the URLs are domain.com/post-name.

What about SEO? I’ve said it before, and I’ll say it again: SEO doesn’t care. Google doesn’t care if your URL is domain.com/foobar or domain.com/2001/foobar – Your readers might care (which is why I advocate using at least the year in your URLs for HEO), but Google, not so much.  If they did, why would MediaWiki be ranked so high on most searches?  No, what SEO cares about is your content, your context, and your relationships.

That really begs the question of why would anyone use CPTs at all?  Last year, Otto advocated you don’t use them if you’re just blogging.  He’s right.  You shouldn’t.  But I use them here to make custom pages for my plugins, and I use them on another site to record all the questions people send me.  They’re unorganized, when you compare them to posts.  But I can, and have, added in taxonomies support to sort them.  Thanks to people like Justin Tadlock, there are tutorials on how to correctly make your Custom Post Type and I know to just add 'taxonomies' => array( 'post_tag', 'category '), to let my CPT use tags and categories. Want to limit it even more? How about linking specific post types and taxonomies!

Some great examples of CPTs are things like bbPress 2.0, the new forum plugin from WordPress, but also this is the future of BuddyPress! People use them to create movie databases, actor pages, a FAQ, or pretty much anything that needs its own structure. What shouldn’t you use CPTs for? Basically if you want something to act like a blog, don’t use CPTs. If you want something to live on it’s own, like a forum, a wiki, a Facebook page, then you want a CPT. If you want multiple blogs, with unrelated, unconnected, content that just happens to have the same author, we call that MultiSite. 2

But they’re not for everything, and never will be, any more than WordPress is right for everyone. So let go of the ‘But they’re posts!’ argument, because you are flat out wrong. They’re post types. Not posts.

Notes:

  1. As of WordPress 3.3, it’s not as disastrous as it was to use /%category%/%postname%/ in your URLs.
  2. See? There are great reasons to use MultiSite!
StudioPress Theme of the Month

Comments

  1. A nice usability solution might be changing the name of the “post” content type to “blog post”, “update” or “article”. Either of those seem more accurate with the advent of CPT.

    • Personally I agree, but close your eyes and picture the forum filled with these posts: “Oh my god! I lost all my posts!” :razz:

      Problem is people don’t read, and far more are educated to think that a post is your blog post and a page is your static page. Even though that isn’t the case. So would it be easier to re-educate the masses? I don’t know. :sad:

  2. As a side note, I think I’m going to start calling them Custom Post-Types, in the hopes that the hyphen makes people stop thinking ‘POST type’.

    • When the name first started coming up, Mark Jaquith and a few others kept telling me to call them “custom content types” so I wouldn’t confuse my clients. I think writing “Custom Post-Types” might help … but I’m still not quite sure how to verbalize a hyphen. ;-)

Half-Elf? Try Half OFF WordPress ebooks!