A custom post type is a new kind of content in WordPress, such as Projects, Properties, Events or Team Members, with its own menu, fields and URLs. Create one with register_post_type on the init hook in a small plugin, or with a tool like ACF or Custom Post Type UI. Add custom fields for the details and a taxonomy for grouping, then design the archive and single templates.
- Use a custom post type when content has its own structure and does not fit Posts or Pages.
- Register post types in a plugin, not the theme, so they survive a redesign.
- Set show_in_rest to true so the block editor and REST API work.
- Pair the post type with custom fields and a custom taxonomy.
- After registering, visit Settings, Permalinks once to refresh URLs.
When do you need a custom post type?
Picture a real estate agency that lists every property as a blog post. Prices sit inside paragraphs, the blog is mixed with listings, and visitors cannot filter by area or bedrooms. Moving those listings into a “Properties” post type with fields for price, bedrooms and location turns a messy blog into a searchable catalogue.
Good candidates for custom post types include portfolios, case studies, products outside WooCommerce, events, courses, job listings, testimonials, recipes and team members.
How do you register a custom post type with code?
Add this to a small site plugin:
add_action( 'init', 'twx_register_project_cpt' );
function twx_register_project_cpt() {
register_post_type( 'project', array(
'labels' => array(
'name' => 'Projects',
'singular_name' => 'Project',
'add_new_item' => 'Add New Project',
),
'public' => true,
'has_archive' => true,
'rewrite' => array( 'slug' => 'projects' ),
'menu_icon' => 'dashicons-portfolio',
'show_in_rest' => true,
'supports' => array( 'title', 'editor', 'thumbnail', 'excerpt' ),
) );
}
Then go to Settings, Permalinks and click Save to refresh the URL rules. Your projects now live at /projects/ and /projects/project-name/.
What do the most important arguments do?
| Argument | What it controls | Typical value |
|---|---|---|
| public | Visible on the front end and in the dashboard | true |
| has_archive | A listing page such as /projects/ | true |
| rewrite slug | The URL base | Plural, lowercase, short |
| show_in_rest | Block editor and REST API support | true |
| supports | Which editor features appear | title, editor, thumbnail, excerpt |
| hierarchical | Parent and child items like pages | false for most types |
| menu_icon | The dashboard menu icon | A Dashicons name |
Custom post types, plugins, theme tweaks and integrations written the WordPress way, update-safe and documented.
Can you create custom post types without code?
Yes. Advanced Custom Fields (ACF) and Custom Post Type UI both let you create post types and taxonomies from the dashboard. ACF also adds the custom fields you will need, such as price, date or gallery. This is a good route for site owners. Developers often prefer code because it is versioned with the project and does not depend on a settings screen.
How do you add custom fields and categories?
- Custom fields: use ACF, Meta Box or the native register_post_meta function for details like price, location or event date.
- Custom taxonomies: use register_taxonomy to create groupings such as Project Type or Property Location, with their own archive pages.
- Templates: classic themes use single-project.php and archive-project.php. Block themes use templates in the Site Editor. Elementor Pro users can design them in Theme Builder with dynamic tags.
How do custom post types help SEO?
Clean structure helps search engines and visitors. Each item gets its own focused URL, archives become useful landing pages, and SEO plugins can set titles, schema and sitemaps per post type. Make sure the post type is included in your XML sitemap and that the archive page has helpful intro text, not just a grid.
To go deeper into custom code, read WordPress hooks and filters and how to build a plugin.
Frequently asked questions
What is a custom post type in WordPress?
A new content type alongside Posts and Pages, such as Projects, Events or Properties, with its own menu, URLs and fields.
Should I register post types in the theme or a plugin?
In a plugin. If you register them in the theme, the content disappears from the dashboard when you change themes.
Why do my custom post type pages show 404?
The rewrite rules have not been refreshed. Go to Settings, Permalinks and click Save.
Can Elementor design custom post type templates?
Yes. Elementor Pro Theme Builder can create single and archive templates for custom post types with dynamic fields.
Do custom post types work with the block editor?
Yes, when show_in_rest is set to true and editor is in the supports list.
Sources
Custom post types, plugins, theme tweaks and integrations written the WordPress way, update-safe and documented.
More WordPress guides
Guide, 4 min readHow to Create a Custom WordPress Theme: Beginner Guide (2026)
Guide, 4 min readHow to Create a WordPress Plugin from Scratch (2026 Beginner Guide)
Guide, 4 min readWordPress Hooks and Filters Explained with Examples (2026 Guide)
Guide, 4 min readHire a WordPress Developer or Learn It Yourself? Cost and Time GuideRather have an expert run your WordPress site?
Tanvir H is a Bangladesh-based WordPress and Elementor web designer with 7+ years of experience, 650+ projects and a 4.9 client rating. New websites, redesigns, fixes, speed, security and SEO, handled by one expert who explains everything in plain English and works with clients worldwide.



