How to create custom post type in WordPress?

LinkedIn
Facebook
WhatsApp
Telegram
Print

Are you frustrated with the same old “Posts” and “Pages” options in your WordPress dashboard? If you want to add more flavor and flexibility to your website, knowing how to create custom post type in WordPress is essential. Whether you run a blog, portfolio, eCommerce store, or business website, mastering custom post types (CPTs) will let you organize and present your content in brilliant, unique ways. In this jam-packed guide, you’ll learn everything about custom post types—including what they are, why they matter, practical use cases, real screen examples, step-by-step creation methods (plugin & code), and answers to all your burning questions. Ready to supercharge your WordPress website? Let’s dive in!

What is a Custom Post Type in WordPress?

By default, WordPress provides two core content types: Posts (for blogs) and Pages (for static content). A custom post type is a specially created content type—like “Portfolio”, “Testimonials”, “Products”, or “Events”—that’s completely separate from these defaults. Think of CPTs as custom buckets for your unique content. This means you can have dedicated areas for things like Galleries, Recipes, Books, or whatever your website needs.

view new custom post type in WordPress dashboard

The beauty of WordPress custom post types is they appear right alongside your main content in the admin menu, complete with their own add/edit screens, categories, and taxonomies. In other words, you can keep your specialized content (like reviews, podcasts, or portfolios) organized and separate rather than mixed with blog articles or pages.

Why Create Custom Post Types in WordPress? (Benefits)

Still wondering why hundreds of thousands of websites rely on custom post types? Here are the top reasons and benefits to create your own:

  • Better Organization: Keep content types separate for filtering, searching, and management.
  • Enhanced User Experience: Display content more intuitively and professionally, tailored to each type.
  • Custom Fields & Metaboxes: Attach unique data and features to each item, like ratings or project dates.
  • Improved SEO: Structure your site for search engines with clearer navigation and keyword focus.
  • Professional Look: Add rich features—filtered galleries, FAQ sections, portfolios, product catalogs—without cluttering your blog.
  • Reusable Content Blocks: Power up your web development by defining CPTs once and using them anywhere on your site.

Portfolios custom post type displayed in WordPress menu

Examples & Use Cases for Custom Post Types

Curious about what you can actually create with WordPress custom post types? Here are some popular, real-world examples you can build today:

  • Portfolio: Showcase client projects and creative work
  • Testimonials: Feature customer reviews and social proof
  • Products: List goods for an eCommerce store
  • Events: Organize upcoming webinars, meetups, or concerts
  • Recipes: Manage a recipe index with cooking times and ingredients
  • FAQs: Display knowledge base or help sections
  • Team Members: Highlight your staff or contributors
  • Courses: Run online courses with lessons and quizzes
  • Books: Catalog book lists for authors or libraries
  • Podcasts: Publish audio episodes with show notes

Examples of custom post types in a WordPress dashboard

Step-by-Step: How to Create Custom Post Type in WordPress

Ready to add your own custom post type to WordPress? There are two main ways: with a plugin (fast & easy) or via custom code (flexible & advanced). Both are safe and effective. Here, I’ll walk you through both options step-by-step.

Option 1: Create Custom Post Type Using a Plugin (No Coding)

If you want a hassle-free, no-code method to create a custom post type, there’s no easier way than using a plugin like Custom Post Type UI (CPT UI). Here’s how:

  1. Go to Plugins > Add New in your WordPress dashboard.
  2. Search for “Custom Post Type UI“.
    Search for Custom Post Type UI plugin
  3. Install and Activate the plugin.
  4. After activation, go to CPT UI > Add/Edit Post Types.
    Custom Post Type UI plugin dashboard
  5. Add a plural name (e.g., Portfolios) and a singular name (e.g., Portfolio).
  6. Set the slug (URL identifier) – like portfolio.
  7. Configure extra settings: Menu Icon, Supports (title, editor, thumbnail), Taxonomies (like categories or tags), etc.
  8. Click Add Post Type.
    Adding a new custom post type with CPT UI

You’ll now see your new post type in the admin sidebar! You can easily add, edit, and manage entries without touching any PHP code.

Option 2: Create Custom Post Type in WordPress with Code

Prefer a hands-on approach or want to keep plugins to a minimum? You can register a custom post type manually with a snippet in your theme’s functions.php or via a site-specific plugin. Here’s how to do it:

  1. Open Appearance > Theme File Editor (or use a code snippets plugin like WPCode).
    WPCode snippet to create a custom post type
  2. Add this code to functions.php (modify portfolio to your need):
  3. function create_portfolio_post_type() {
      register_post_type('portfolio',
        array(
          'labels' => array(
            'name' => __('Portfolios'),
            'singular_name' => __('Portfolio'),
          ),
          'public' => true,
          'has_archive' => true,
          'menu_icon' => 'dashicons-portfolio',
          'supports' => array('title','editor','thumbnail', 'custom-fields'),
          'rewrite' => array('slug' => 'portfolio'),
          'show_in_rest' => true, // for block editor support
        )
      );
    }
    add_action('init', 'create_portfolio_post_type');
  4. Save changes. Your custom post type (in this case, “Portfolios”) will now appear in the admin menu!
    Register custom post type in WordPress with PHP code
  5. Customize further as needed: add custom fields, taxonomies, or change menu icons.

WordPress makes it easy to extend custom post types for any content type—whether you want simple features or a complex custom website.

WordPress custom post types showing content types separated

Pro Tip:

For even more advanced configuration (labels, capabilities, REST API), use the GenerateWP Post Type Generator—it creates code snippets you can copy-paste directly.

Common Challenges, Myths & Misconceptions

Thinking about making your own custom post type in WordPress but feeling nervous? Here are some myths, objections, and practical advice:

  • Myth #1: “Custom post types slow down my website.”
    Reality: Well-coded custom post types are super-lightweight. It’s bloated plugins or poorly coded themes that create a sluggish site, not CPTs themselves.
  • Myth #2: “I’ll break my theme if I use custom post types!”
    Truth: Plugins like CPT UI make everything undoable and safe. Even with code, CPTs are isolated and don’t affect existing posts or pages.
  • Myth #3: “It’s really hard to display custom post types on my site.”
    Fact: WordPress has great tools—like the WP_Query class, page templates, and Gutenberg blocks—that let you display custom post type entries anywhere.
  • Challenge: Migrating content from regular posts to your new post type.
    Solution: Use plugins like “Post Type Switcher” or export/import functionality.
  • Challenge: CPTs not showing on your home page or archives by default.
    Solution: Adjust theme queries or use a custom page template. Plenty of tutorials exist for popular themes (see support docs).

Custom post type UI plugin showing custom content types in WordPress

Frequently Asked Questions (FAQs)

1. What exactly is a custom post type in WordPress?

A custom post type is a unique content type you can create in WordPress, completely separate from regular posts and pages. Examples include portfolios, products, testimonials, or recipes.

2. Do I need to know PHP to create a custom post type?

No! You can use plugins like Custom Post Type UI or Pods to generate and manage custom post types without writing any code.

3. How do I display custom post types on my website?

You can use the WordPress block editor (Gutenberg), create custom page templates, or use WP_Query in your theme. Many plugins and themes also offer built-in ways to display CPTs.

4. Can I use categories and tags with custom post types?

Yes! You can enable built-in or custom taxonomies for any custom post type. This helps you organize and filter your entries even further.

5. Is it safe to delete a custom post type plugin?

If you created a CPT with a plugin, deactivating or deleting the plugin will hide those entries in admin, but their data remains safe in your database. To keep everything visible, migrate the CPT code to your theme or another plugin first.

6. Will a custom post type break my SEO or permalinks?

Not at all! In fact, well-structured custom post types can boost SEO by keeping your site organized. Just remember to flush permalinks (save from Settings > Permalinks) after adding new CPTs.

7. Can I create custom post types on WordPress.com?

Custom post types are available on WordPress.com Business plans or higher, or by using plugins if your plan supports installing them.

8. What’s the difference between custom post types and custom taxonomies?

Custom post types are the actual pieces of content (like “Events”), while custom taxonomies are categories or tags (like “Location” or “Genre”) used to organize those entries.

9. How do I migrate old posts to a new custom post type?

Use plugins like “Post Type Switcher” to bulk change existing post types in just a few clicks, or do it manually from the database (for advanced users).

10. What’s the best plugin to create custom post types?

Popular plugins include Custom Post Type UI, Pods, JetEngine (for Elementor users), and ACF (Advanced Custom Fields) for extra field options.

Conclusion: Take Action & Unlock WordPress Power with Custom Post Types

Now you know how to create custom post type in WordPress—with or without code—it’s time to get creative! Custom post types are one of WordPress’s most under-utilized superpowers. They help you structure your website, improve SEO, deliver a pro-level user experience, and delight your visitors.

Think beyond “Posts” and “Pages”. Start building with CPTs today, whether you manage a portfolio, recipe blog, course site, or online store. Choose the plugin route for speed or code for max flexibility—it’s all in your hands!

Got more questions about WordPress custom post types? Browse the official docs, check out detailed tutorials at WPBeginner, or ask in the WordPress.org forums. The possibilities are endless—get building, and give your WordPress site the structure it deserves.


Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post