core

Custom Post Type in WordPress

A custom post type (CPT) is a content category in WordPress that lets you store and display a specific type of content separately from regular blog posts and pages. WordPress ships with five buil...

What Is a Custom Post Type in WordPress?

Who this is for: Small business owners and beginners building their first WordPress site who want to organize content beyond basic blog posts and pages.

A custom post type (CPT) is a content category in WordPress that lets you store and display a specific type of content separately from regular blog posts and pages. WordPress ships with five built-in post types — posts, pages, attachments, revisions, and navigation menus — and custom post types extend that list with whatever your site needs.


Why Custom Post Types Exist

WordPress started as blogging software. Every piece of content was a “post.” That model breaks down fast when you’re building a portfolio site, a restaurant with a menu, or a real estate listing platform. A testimonial is not a blog post. A product is not a page.

Custom post types solve this by giving each content category its own admin menu, its own URL structure, and its own set of fields. We see this on almost every client site we build beyond a basic brochure: a law firm needs a “Case Studies” CPT, a gym needs a “Classes” CPT, a WooCommerce store already uses CPTs under the hood — product is a custom post type registered by WooCommerce itself.

WordPress introduced the register_post_type() function in version 2.9 (released December 2009). As of 2026, it remains the canonical way to create CPTs programmatically, documented in the WordPress Developer Handbook.


When You’ll Encounter a Custom Post Type

You encounter CPTs in three situations:

  1. A plugin creates one for you. WooCommerce registers product. The Events Calendar registers tribe_events. You see them as new menu items in wp-admin without touching code.
  2. You need structured, repeating content. Team members, testimonials, FAQs, properties, recipes — anything where each entry shares the same structure benefits from its own CPT.
  3. You want clean URL organization. CPTs get their own permalink base (e.g., /portfolio/project-name/), which keeps content logically separated and easier to manage.

How to Add a Custom Post Type (No Code Required)

For non-developers, the fastest route is a plugin. Custom Post Type UI (wordpress.org/plugins/custom-post-type-ui) has over 2 million active installs and provides a UI for registering CPTs and custom taxonomies inside wp-admin. In our testing, setup takes under five minutes: install the plugin, go to CPT UI → Add/Edit Post Types, fill in the slug and labels, and save.

Page builders like Elementor Pro and Divi also include CPT support, letting you design custom templates for each post type’s single and archive views without switching tools.

If you do want to use code, the minimum registration looks like this:

register_post_type( 'portfolio', [
    'label'  => 'Portfolio',
    'public' => true,
    'supports' => [ 'title', 'editor', 'thumbnail' ],
] );

This goes in your theme’s functions.php or a site-specific plugin. Never add this to a third-party theme directly — it disappears on theme updates.


  • Custom Taxonomy — categorizes entries within a CPT (e.g., “Project Type” for a Portfolio CPT)
  • Custom Fields / Meta Fields — stores extra data attached to a CPT entry
  • Post Template — the PHP file or page builder layout that controls how a CPT’s single entry displays
  • Archive Page — the listing view for all entries in a CPT
  • register_post_type() — the WordPress core function that creates a CPT programmatically

Additional Reading

Last verified: April 2026