How do I create custom post types in WordPress?

Applies to: WordPress 6.x and later
Last updated: September 2025


Problem

By default, WordPress only comes with a few post types like posts and pages. However, many websites need additional structured content such as portfolios, events, products, or testimonials. Creating custom post types allows you to manage this content more effectively and keep it organized separately from standard blog posts.


Solution

You can create custom post types in WordPress either programmatically (by adding code) or by using a plugin that simplifies the process. Both approaches allow you to register new content types and define how they behave in the WordPress dashboard.

Using a Plugin (easier for non-developers)

  1. Install and activate the Custom Post Type UI plugin.
  2. Navigate to CPT UI > Add/Edit Post Types.
  3. Fill in the required fields, such as post type slug, plural label, and singular label.
  4. Adjust settings for supports, taxonomies, and visibility.
  5. Save the post type.
  6. Your new post type will appear in the WordPress dashboard menu.

Optional methods or tools

  • Pods Framework: A plugin that lets you create custom post types, taxonomies, and custom fields.
  • Advanced Custom Fields (ACF): Often used in combination with custom post types to extend functionality with custom fields.

Best practices or tips

  • Use descriptive slugs (e.g., “events” instead of “ev”).
  • Keep custom post types separate from theme files if possible by creating a small site-specific plugin. This way, you won’t lose them if you switch themes.
  • Combine with custom taxonomies for better content organization.
  • Test permalink settings and flush rewrite rules (Settings > Permalinks > Save Changes) if the new post type pages return 404 errors.