WordPress Development
WordPress Custom Post Types: How to Register, Configure, and Display Custom Content
Posts and Pages are just the beginning. Custom Post Types let you model any content with structured fields and its own admin interface.
Simple Automation Solutions
·
·⌛ 9 min read
WordPress ships with two content types: Posts and Pages. Custom Post Types let you add your own: Portfolio, Testimonials, Team Members, Properties, Events. Each gets its own admin interface, URL structure, and set of custom fields. This is one of WordPress’s most powerful extensibility features.
What custom post types are
A Custom Post Type (CPT) is a new content type you register in WordPress that behaves like Posts or Pages but with its own label, icon, capabilities, and URL structure. Once registered, it appears in the WordPress admin sidebar as its own section. CPTs are typically paired with Custom Taxonomies (custom categories and tags) and Custom Fields (additional data fields) to create a complete content model.
When to use custom post types
- Portfolio: instead of blog posts for case studies, create a Portfolio CPT with fields for client name, tools used, and project URL
- Team Members: each person gets a CPT entry with fields for role, bio, LinkedIn URL, and headshot
- Testimonials: structured entries with fields for reviewer name, company, rating, and text
- Properties: real estate listings with price, bedrooms, bathrooms, location, and status fields
- Events: event entries with date, location, ticket URL, and speaker fields
Method 1 – Register a CPT with code
Register CPTs using the register_post_type() function in your child theme’s functions.php or a custom plugin. Always use a plugin, not a theme, so your CPTs survive theme changes.
Add add_action('init', 'my_custom_post_types'); to your functions. WordPress fires init early in the load process, ensuring the CPT is available for all other functionality.
The labels array defines all text strings WordPress uses in the admin: name, singular_name, add_new, add_new_item, edit_item, view_item, and more.
Determines which standard WordPress fields appear: title, editor, thumbnail, excerpt, author, comments, revisions, custom-fields. Include only what your content type actually needs.
The rewrite parameter defines the URL structure: 'rewrite' => ['slug' => 'portfolio'] makes entries available at /portfolio/project-name/
Go to Settings › Permalinks and click Save Changes once after registering each CPT to regenerate URL rules.
Method 2 – CPT UI plugin (no code)
CPT UI provides a visual interface for registering Custom Post Types and Custom Taxonomies without writing code. Install it, go to CPT UI › Add/Edit Post Types, and fill in the form. All the same parameters available in code are configurable through the plugin’s form.
Adding custom fields to CPTs
Displaying CPT content
- Archive pages: WordPress creates archives at /portfolio/ (if has_archive: true) listing all CPT entries
- Single templates: create single-{post-type}.php in your child theme to customise the individual entry layout
- Gutenberg Query Loop block: pull CPT entries into any page with filtering and layout control
- Elementor Pro: the Posts and Loop Grid widgets can display any CPT with custom templates
Need custom post types built for your WordPress site?
Simple Automation Solutions builds bespoke WordPress content models including custom post types, taxonomies, and fields for businesses worldwide.
Frequently asked questions
Should I register custom post types in a plugin or my theme?+
Always in a plugin. If you register CPTs in your theme and then switch themes, all associated content becomes inaccessible. A custom functionality plugin containing only your CPT and taxonomy registrations survives theme changes correctly.
Do custom post types affect WordPress SEO?+
CPTs can be a significant SEO asset when structured correctly. Each CPT entry is a URL that can rank in search results. Set meaningful URL slugs, ensure CPT archives are indexable, and add appropriate title and meta tags via Rank Math or Yoast SEO.
What is the difference between a custom post type and a custom taxonomy?+
A CPT is a content container: each entry is a piece of content. A Custom Taxonomy is a classification system for grouping CPT entries, like categories for blog posts. A Portfolio CPT might have a Project Type taxonomy (branding, web, print) and an Industry taxonomy (finance, healthcare, retail).
Simple Automation Solutions is a global digital product studio specialising in WordPress and Bubble.io development. We serve founders, startups, and businesses worldwide — delivering production-ready websites built to rank, convert, and scale.
