Labour Day Logo
Flat 26% OFF
USE CODE: LABORDAY26

CLAIM 26% DISCOUNT NOW

WordPress Custom Post Types: What They Are and How to

WordPress custom post types

WordPress comes with built-in post types like Posts and Pages, but many websites need more specialized ways to organize content. Whether you’re creating a portfolio, managing events, publishing job listings, or running a WooCommerce store, custom post types help you structure content more effectively. They allow you to create dedicated content types with their own fields, taxonomies, templates, and archive pages.

In this beginner’s guide, you’ll learn what WordPress custom post types are, when to use them, and how to create them with or without code.

What Are WordPress Custom Post Types?

Before you create a custom post type, it helps to understand how WordPress stores content.

WordPress includes several built-in post types, including Posts, Pages, Media Attachments, Revisions, and Navigation Menus. Each serves a different purpose.

A custom post type extends this system by allowing you to create a new content type with its own structure, fields, and organization.

A custom post type (CPT) is a custom content type that extends WordPress beyond standard posts and pages. It allows you to create structured content with its own fields, taxonomies, templates, and archive pages.

The key differences include:

  • Custom administrative interfaces tailored to specific content types
  • Unique URL structures and archive pages
  • Specialized template files for display
  • Custom taxonomies and metadata fields
  • Different user permissions and capabilities

Real-World Examples of Custom Post Types

Here are some common examples of custom post types WordPress users create:

  • Portfolio for photographers, designers, and creative professionals to showcase work samples with project dates, client information, and technical specifications
  • Team Members with bios, roles, headshots, and contact information
  • Testimonials including ratings, client company names, and project types
  • Events with dates, venues, ticket prices, and speaker details
  • Recipes including ingredients, prep time, nutrition fields, and difficulty levels
  • Job Listings with position details, location, salary, and application links
  • WooCommerce Products with pricing, inventory, attributes, and product variations. WooCommerce stores products as a custom post type called product, making it one of the most widely used CPT examples.

When Should You Use a Custom Post Type in WordPress?

You should create a custom post type when a content type has its own structure, fields, or purpose that differs from regular blog posts.

For example:

  • Use posts for blog articles.
  • Use pages for static content.
  • Use a Portfolio CPT for client projects.
  • Use an Event CPT for upcoming events.
  • Use a Product CPT for WooCommerce products.

If you find yourself adding the same custom fields repeatedly to posts, a custom post type is usually the better solution.

Custom Post Types vs Posts vs Pages

Feature Posts Pages Custom Post Types
Use CaseBlog/news/Product updates/Company announcementsStatic content (About us, Contact us, Privacy policy, etc.)Specialized content (products, portfolios, etc.)
Hierarchy SupportNo Yes (Parent/Child)Optional 
Categories/TagsYes No Optional/custom
RSS FeedYes No Optional 
CommentsUsually enabledUsually disabledOptional 
Chronological OrderYes No Optional 

How to Create a Custom Post Type in WordPress Without Coding

If you want to create a custom post type in WordPress without writing code, a plugin is the easiest option.

Use a Custom Post Type Plugin

Step 1: Install and Activate the Plugin

Navigate to Plugins Add Plugin in your WordPress dashboard. Search for your chosen custom post type plugin for WordPress (such as Custom Post Type UI), install it, then activate it.

Search for a custom post type plugin in the WordPress Plugins directory

Step 2: Create a New Custom Post Type

Open the plugin’s interface (e.g., “CPT UI” tab) and click “Add/Edit Post Types”. Enter a slug for your post type, such as ‘portfolio’, ‘event’, or ‘recipe’, keeping it lowercase and avoiding spaces.

Enter a custom post type slug in the WordPress custom post type plugin settings

Step 3: Configure Post Type Settings

Fill in the labels that control how the CPT appears in menus and admin screens. Select features you want to support, such as:

  • Title
  • Editor (content area)
  • Featured image
  • Custom fields
  • Excerpts
  • Revisions
Configure WordPress custom post type settings and supported features

Assign taxonomies if you want categories or tags for your CPT. You can create new ones in the plugin interface.

Step 4: Publish and Test Your Custom Post Type

Save your settings, then visit the dashboard to confirm that your new CPT now appears in the main menu. Add a test entry to make sure everything works as expected.

Add a test entry to verify your new WordPress custom post type

Best Plugins for Creating Custom Post Types

Several excellent plugins can help you create custom post type content without coding:

How to Create a Custom Post Type in WordPress Using Code

For developers who want full control, how to register a custom post type in WordPress using code is straightforward.

Understanding the register_post_type() Function

WordPress provides a built-in function called ‘register_post_type()’ that handles everything. You just need to add a block of PHP to your theme’s ‘functions.php’ file or a custom plugin.

Important Arguments You Should Know

Key arguments for ‘register_post_type()’ include:

  • ”public” – Whether the post type is publicly accessible
  • ”has_archive” – Whether to enable archive pages
  • ”supports” – Which editor features to use (title, editor, thumbnails, custom fields, revisions)
  • ”rewrite” – Sets clean URLs like ‘/portfolio/project-name/.’
  • ”show_in_rest” – Enables support for the Gutenberg Block Editor and the WordPress REST API. 

Common Mistakes When Creating Custom Post Types

We’ve seen many WordPress site owners create custom post types before planning their content structure. This often leads to duplicate content, confusing URLs, and difficult site maintenance.

Before creating a CPT, decide:

  • What content belongs in the CPT
  • Which custom fields you need
  • Whether you need categories or custom taxonomies
  • How archive pages should appear
  • Whether search engines should index the custom post type archive 

A few minutes of planning can save hours of cleanup later.

How to Add Content to a Custom Post Type

Creating New Entries

Once your custom post type is registered, you’ll see a new menu item in your WordPress admin dashboard. Click it, then click “Add New” to create content just like you would with regular posts or pages.

Using Categories and Tags

You can assign existing categories and tags to your CPT, or create custom taxonomies specifically for your post type.

Adding Custom Fields

Custom fields allow you to capture specific information about each entry. For example, a “Car” custom post type might have fields for make, model, year, and price. You can add custom fields using:

  • WordPress’s built-in custom fields feature
  • Plugins like Advanced Custom Fields (ACF)
  • Custom code in your theme

Organizing CPT Content Efficiently

Each custom post type has its own section in the WordPress admin so that you can manage your custom content separately from other WordPress post types. This separation makes content management far more efficient.

How to Display Custom Post Types on Your Website

Custom Post Type Archives

Your CPT’s archive will usually appear at ‘/(slug)/’, unless you change the rewrite rules. You can customize the archive template using ‘archive-{post_type}.php’ in your theme.

Single Custom Post Templates

Individual CPT entries can be displayed using ‘single-{post_type}.php’ in your theme. In block themes, you can build these templates using Full Site Editing. Open AppearanceEditor, create a new Template, and choose your CPT from the list.

Displaying CPTs in Navigation Menus

Custom post types can be added to navigation menus just like pages and posts. Simply go to AppearanceMenus and add your CPT items.

Showing CPTs Using Gutenberg Blocks and Page Builders

You can use the Query Loop block to display CPT items anywhere on your site. Page builders like Elementor also support displaying custom post types through various widgets and blocks.

How to Password Protect Custom Post Types in WordPress

WordPress includes basic password protection for individual content items, but it lacks advanced access control features. If you want to protect custom post types more efficiently, secure multiple items at once, or manage access at scale, a dedicated WordPress password protection plugin like Password Protected is a better solution.

Getting started is simple. Install and activate the Password Protected plugin, then configure your protection settings from the plugin dashboard. To protect custom post types with Password Protected, you’ll need the Pro version, which adds support for custom post type protection and advanced access controls.

Activate the Password Protected plugin to secure WordPress custom post types

Many websites use custom post types to store premium content, private client resources, member-only materials, or restricted WooCommerce products. In these cases, password protection helps control who can access that content.

If you want to protect WooCommerce products specifically, check out our guide on how to password protect WooCommerce products.

Configure Password Protected settings to protect WordPress custom post types

Conclusion

WordPress custom post types are one of the most powerful features for creating structured, organized, and scalable websites. They transform WordPress from a blogging platform into a fully-fledged content management system capable of handling virtually any type of content.

Start small, experiment with one custom post type, and gradually expand as your site grows. With the right approach, custom post types will help you build a WordPress site that’s organized, scalable, and perfectly tailored to your content needs.

Frequently Asked Questions

What are custom post types in WordPress?

WordPress custom post types are specialized content containers that extend beyond standard posts and pages. They allow you to create structured content types such as portfolios, products, events, and team members, each with its own fields, templates, and admin interfaces.

Do I need a plugin to create custom post types?

No. You can create custom post type content using code with the ‘register_post_type()’ function. However, plugins like Custom Post Type UI make the process easier for non-developers.

Can custom post types have categories and tags?

Yes. You can assign existing categories and tags to CPTs or create custom taxonomies specifically for your CPT.

Are custom post types SEO-friendly?

Yes, when properly configured. Choose SEO-friendly URLs, optimize your archive pages, and ensure search engines index your CPTs. Custom post types can actually improve SEO by giving search engines more clarity about your site’s structure.

Can I password protect a custom post type?

Yes. WordPress provides basic password protection for individual content items, but plugins like Password Protected make it easier to protect custom post types, categories, and other content with advanced access controls.

What is the difference between a custom post type and a custom taxonomy?

A custom post type is a content container (like “Products”). A custom taxonomy is a classification system for organizing that content (like “Product Categories”).

Are custom post types compatible with Gutenberg?

Yes. Custom post types can fully support the Gutenberg Block Editor when you enable REST API support during registration using the show_in_rest setting.

Do custom post types affect website performance?

Custom post types have little impact on performance when configured correctly. Performance issues usually come from inefficient database queries, excessive custom fields, or poorly optimized plugins rather than the CPT itself.