What Is a Custom Post Type in WordPress?
A custom post type is a content type you register in WordPress alongside built-in types like posts, pages, and attachments. Site owners, plugins, and themes register custom post types to manage distinct content such as products, events, or portfolio items, and each type can have its own admin screen, public URLs, and templates when configured.
More About Custom Post Types
WordPress ships with several built-in post types. The most common are posts, pages, attachments, revisions, navigation menus, block templates, and template parts. Those cover everyday publishing. The moment your site manages a different kind of content, a custom post type keeps it organized and separate.
What a custom post type gives you
Say you run an online store and register a product post type. The registration arguments decide what it gets: make the type public and it has its own top-level menu in the WordPress admin and its own URL structure, such as example.com/products/blue-widget/ instead of mixing into the blog feed. Templates are a separate job: your theme or a plugin supplies a dedicated product template, or WordPress falls back to the general-purpose templates in its hierarchy, like single and index. Either way, store items never clutter your posts. If you've ever edited a product in an e-commerce plugin, you've already used a custom post type the plugin registered for you.
The pattern repeats across the web: products for online stores, assignments for e-learning sites, movies for review sites. Register a type with its has_archive option enabled and it also gets a listing page at its slug, such as example.com/products/, which your theme can style with a dedicated archive template.
Custom post types vs. taxonomies and custom fields
These three tools solve different problems, and mixing them up is a common point of confusion:
- Use a custom post type when the content is a different kind of thing that needs its own admin menu, templates, and URLs: products, events, portfolio pieces.
- Use categories, tags, or a custom taxonomy when you're grouping the same kind of content, like sorting recipes by cuisine.
- Use custom fields when you're attaching extra data to individual entries, like a price on each product.
How to create a custom post type
You have two paths: code or a plugin. In code, you call the register_post_type() function from the init hook. The WordPress Plugin Handbook recommends putting that code in a plugin rather than your theme so your content stays reachable if you ever switch themes. Take the code path if you're comfortable maintaining a small plugin. If not, a widely used point-and-click option is Custom Post Type UI, a free plugin whose WordPress.org listing reports more than 1,000,000 active WordPress sites as of August 2026. Either way, our guide to custom post types walks through creating and displaying one step by step.
Common problems and how to fix them
Two common custom post type problems are 404 errors on new URLs and post types disappearing after a theme switch. The 404s happen because WordPress doesn't rebuild its rewrite rules, the internal map that turns permalinks into database queries, until you tell it to. The fix takes seconds: go to Settings > Permalinks and click Save Changes, which regenerates the rules. The disappearing act happens when a post type is registered in a theme's functions.php file: switch themes and the registration code stops running, so the entries stay in the database but nobody can reach them until the type is registered again. Register your post types in a plugin from day one and re-save your permalinks right after, and you'll avoid both.
Frequently Asked Questions
- Not by default. When you register a custom post type, attach existing taxonomies through the taxonomies argument of register_post_type(), or register a custom taxonomy just for that type.
- Usually nothing is deleted. Deactivation unregisters the post type, so its entries stay in the database but vanish from the admin and your site until the type is registered again. Back up and check the plugin's documentation first: uninstalling, or a data-removal option, can erase them.
- Yes. Pairing a custom post type with custom fields is the standard way to model structured content: an event type with date and venue fields, for example. Enable them through the supports argument of register_post_type() or with a fields plugin.
Powerful WordPress Hosting
Reliable, lightning-fast hosting solutions specifically optimized for WordPress. Find the perfect plan for you by clicking below.
WordPress Hosting Plans