Custom post types explained for non-developers
A custom post type is a new kind of content, such as Projects or Team, with its own admin menu, URLs and layout. When you need one and how it is built.
By Sohail Hussain21 November 20265 min read
A custom post type is a new kind of content in WordPress, alongside the built-in Posts and Pages. Projects, Team members, Locations, Jobs and Case studies are typical examples. Each gets its own item in the admin menu, its own list screen, its own URL pattern (such as /projects/new-plant-pune/) and its own template, so every item looks consistent and can be listed, filtered and searched apart from your blog. You need one when you have more than a handful of items that share the same shape.
When we plan a site in our website design and development work, agreeing this content model is one of the first steps, before any design.
What is a custom post type, in plain terms?
WordPress stores almost all content in one database table, with a label saying what type each item is. Blog posts have the type post. Pages have the type page. Files in the media library are attachment. Navigation menu items and synced patterns are post types too.
A custom post type is simply another label, with its own settings. Once it is registered, "Projects" appears in the admin menu with "All Projects" and "Add New", just like Posts. Editors add projects. The site shows them at their own addresses and in their own lists.
WooCommerce products are a custom post type. So are events in most event plugins. You have probably used one without knowing it.
When does your site need one?
When most of these are true:
- You have, or will have, more than about ten items of the same kind.
- Each item has the same pieces of information. A project has a client, a sector, a year, a location and photos.
- Visitors need to browse or filter them, or they appear in several places on the site.
- They are not news or articles, which is what Posts are for.
| Content | Best home | Why |
|---|---|---|
| News and articles | Posts | Dated, categorised, included in the RSS feed |
| About, Contact, services overview | Pages | One-off pages, designed by hand |
| Projects or case studies | Custom post type | Many items, same structure, filtered by sector |
| Team members | Custom post type | Reused on About, service and location pages |
| Office locations | Custom post type | Address, map and hours on each, listed together |
| Job openings | Custom post type | Opened and closed often, listed on Careers |
| Testimonials | Custom post type, or a pattern if there are only a few | Reused across pages |
| Products for sale | WooCommerce | It registers its own product type |
The common mistake is the opposite one: forty project pages built as Pages, each laid out by hand, plus a Projects page someone updates manually. It works until the fortieth. Then every redesign means editing forty pages.
How do post types, taxonomies and custom fields fit together?
Three pieces, each with one job:
- The post type is the kind of thing: a Project.
- Taxonomies group items: Sector (Manufacturing, Healthcare) or Service. Categories and Tags are the built-in taxonomies for posts, and you can add your own to any post type.
- Custom fields hold each item's details: client name, year completed, project value, a gallery. WordPress stores these as post meta, and plugins such as Advanced Custom Fields give editors a proper form to fill in.
Together they replace a free-form page with a structured record. The editor fills in a form, and the template decides how it looks. That is how a site with 200 projects stays consistent.
How is a custom post type created?
Either in code, or through a plugin's settings screen. Both produce the same result.
In code, a developer calls register_post_type() on the init hook, ideally in a small site plugin. This example registers Projects, editable in the block editor, with a listing page at /projects/:
<?php
/**
* Plugin Name: Site content types
*/
add_action( 'init', function () {
register_post_type( 'project', array(
'labels' => array(
'name' => 'Projects',
'singular_name' => 'Project',
),
'public' => true,
'has_archive' => true,
'show_in_rest' => true,
'menu_icon' => 'dashicons-portfolio',
'supports' => array( 'title', 'editor', 'thumbnail', 'excerpt' ),
'rewrite' => array( 'slug' => 'projects' ),
) );
} );
A few details from the register_post_type() reference that matter in practice:
- The key,
projecthere, must be 20 characters or fewer and use only lowercase letters, numbers, dashes and underscores. show_in_restmust betruefor the post type to use the block editor. Without it, editors get the old classic editor.- After registering, go to Settings → Permalinks and click Save once so the new URLs work. Code should never flush rewrite rules on every page load.
Choose the URL slug with care, because changing it later means redirects. Our URL slug generator turns a label into a clean slug.
Without code, Advanced Custom Fields and its fork Secure Custom Fields both include a screen for registering post types and taxonomies, which suits sites where nobody writes PHP.
What goes wrong with custom post types?
- Registered in the theme. If the code lives in the theme's
functions.php, switching themes makes the post type vanish from the admin. The content is still in the database, but nobody can see it. Register post types in a plugin, as above. - Too many types. "Projects" and "Featured projects" should be one type with a field or a taxonomy. Each extra type is another list screen and template to maintain.
- Thin archive pages. An archive that lists twelve titles and nothing else is a weak page for search. Give it an introduction and useful filters, or set
has_archivetofalseand build the listing on a normal page instead. - Things indexed by accident. Public post types are added to WordPress's built-in XML sitemap automatically. Content that should not appear in search, such as internal staff profiles, should not be public.
Do you need a developer?
To register a post type through a plugin's settings screen, no. For the templates that show it well (the archive layout, the single-item design, the filters), usually yes, at least once. After that, editors add items without anyone's help, which is the point.
If your site is a dozen pages and a blog, you do not need custom post types at all. They earn their place when content repeats. For how they fit into a WordPress setup overall, see WordPress for business websites. If you are deciding how the site should be built around them, Elementor vs Gutenberg vs a custom theme covers that choice.
Was this guide useful?