WordPress Custom Post Types: Complete Guide 2026

Published April 21, 2026

WordPress Custom Post Types Guide

WordPress ships with posts and pages as default content types. Custom Post Types (CPTs) let you create structured content that doesn't fit the blog post mold — portfolio projects, team members, testimonials, products, events, recipes, or any other content with consistent fields and templates.

When to Use Custom Post Types

Use a CPT when you have content that: appears repeatedly in a consistent structure, needs its own archive page, requires custom fields specific to that content type, and should be managed separately from blog posts. Don't use CPTs for one-off pages or content that's genuinely blog-like.

Registering a Custom Post Type

Register CPTs using register_post_type() inside a function hooked to init. Key arguments:

Using Plugins Instead of Code

If you prefer not to write PHP, Custom Post Type UI (CPT UI) and Pods provide graphical interfaces for CPT creation. CPT UI handles post type and taxonomy registration; Pods adds field management. For production sites, transitioning from plugin-based CPTs to code-based registration improves reliability and portability.

Custom Fields for CPTs

CPTs become powerful when combined with custom fields. Advanced Custom Fields (ACF) is the standard solution — register field groups for specific post types and the fields appear in the admin editor automatically. Fields can be text, numbers, images, relationships to other posts, Google Maps, repeaters, and more.

Display Templates

WordPress template hierarchy looks for single-{post_type}.php for individual CPT posts and archive-{post_type}.php for archives. Create these files in your theme (or child theme) to fully control CPT display. Gutenberg block themes use template files in the /templates/ directory instead.

Gutenberg Support for CPTs

Add 'show_in_rest' => true and 'supports' => array('editor') to enable the Gutenberg editor for your CPT. Without show_in_rest, the classic editor loads instead of Gutenberg — this is a common source of confusion when setting up CPTs.