Categories
Elementor

Creating Custom Post Types in WordPress The Complete Guide

There are a couple of ways to create custom post types in WordPress. You can either go the user-friendly route with a plugin like Custom Post Type UI, or you can get your hands dirty and write some custom PHP using the register_post_type function.

Honestly, both paths lead to the same destination: transforming a standard website into a highly organized, specialized content machine. We'll walk through both methods in this guide, making sure you have everything you need to build the exact structure your project calls for.

Why Custom Post Types Will Change How You Use WordPress

If you’ve ever tried to manage a portfolio, real estate listings, or movie reviews using standard WordPress ‘Posts,’ you know the pain. Everything gets dumped into the same bucket, making the back-end a mess and the front-end a puzzle.

This is exactly the problem custom post types (or CPTs) were made to solve. They give you the architectural backbone you need to build a structured, scalable, and intuitive website. Instead of one generic content bin, you get to create distinct, purpose-built containers for your information. That organizational clarity is a total game-changer.

Finally, a Structured Content Strategy

Picture a real estate website. With CPTs, you can create a dedicated "Properties" post type. Suddenly, each property isn't just a blog post; it's its own unique object with its own set of fields, like price, square footage, and the number of bedrooms. This is miles more efficient than trying to shoehorn everything into the standard post editor.

This same idea works for tons of different scenarios:

  • Portfolio Site: A "Projects" CPT is perfect for neatly organizing case studies and client work.
  • E-learning Platform: A "Courses" CPT keeps your lesson plans and video modules separate from your blog updates.
  • Business Directory: A "Listings" CPT can handle company profiles, contact details, and service categories with ease.

By separating these different content types, you drastically improve the admin experience for your team. They can find, update, and manage specific entries without having to dig through a mountain of unrelated blog posts. That means fewer mistakes and a much smoother workflow.

The Power Couple: CPTs and Page Builders

The real magic happens when you pair custom post types with a visual page builder like Elementor. There's a reason this combination is so popular. As of February 2026, WordPress powers 42.8% of all websites, and its flexibility is a huge part of that success. In fact, over 70% of users now prefer to use CPTs with page builders, which lets them build dynamic websites fast, without writing code. You can find more insights on WordPress trends over at pb4host.com.

With this duo, you can design a template once and have it automatically apply to every single entry in your custom post type. Let's say you have a "Team Members" CPT. You could design a slick profile page template, and every time you add a new person, their information automatically populates that design. It ensures perfect consistency and saves you a ton of time.

Choosing Your Method: Code vs. Plugins

So, you're ready to create custom post types in WordPress. You've hit your first major crossroad: do you roll up your sleeves and write the PHP yourself, or do you grab a plugin to do the heavy lifting?

Honestly, there's no single "right" answer. The best path for you depends entirely on your project, your comfort level with code, and what you're planning for the long haul.

You've essentially got two choices. The first is the hands-on approach using the register_post_type function, which gives you absolute control and top-notch performance. The second is using a friendly plugin like Custom Post Type UI (CPT UI), which makes the whole process fast and visual.

This is the key step that takes a standard WordPress site and turns it into a genuinely dynamic and organized platform.

Flowchart illustrating the transformation of a WordPress site from standard to dynamic using custom post types.

As you can see, CPTs are the engine that transforms a basic blog into a powerful, structured content machine.

The Plugin Approach: Simplicity and Speed

For most designers, marketers, and site builders, going the plugin route is the most practical place to start. Tools like CPT UI give you a straightforward interface where you set up your post types by filling out a few forms and checking some boxes.

This approach is lightning-fast. It completely removes the need to dig into your theme's functions.php file or build a custom plugin from scratch.

This method is perfect for:

  • Quickly Prototyping: You can spin up a CPT in minutes to test an idea without committing to writing a bunch of code.
  • Non-Developers: It empowers anyone who isn't comfortable with PHP to build highly structured websites.
  • Easy Client Handoffs: It gives clients a simple, visual way to see and manage their own content types.

A huge win for the plugin method is portability. Because the plugin handles the CPT registration, your content structure isn't tied to your theme. If you decide to switch themes later, your "Portfolio" or "Real Estate Listings" CPTs—and all the content inside them—will stick around, no problem.

The Code Method: Control and Performance

On the flip side, if you're a developer building a custom theme or a complex application, writing the PHP yourself offers total control. This is often seen as the professional standard.

By using the register_post_type function directly, you can define every single argument and capability with surgical precision. This ensures your CPT behaves exactly the way you want it to, with no extra overhead.

This manual method also means one less plugin on your site, which can lead to a slightly lighter footprint and fewer potential conflicts. It also lets you version-control your CPT definitions right alongside your theme or site-specific plugin—a massive advantage for development teams.

To help you decide, I've put together a quick comparison table that breaks down the pros and cons of each approach.

Code vs Plugin: Which CPT Method Is Right for You?

Factor Custom Code (register_post_type) Plugin (e.g., CPT UI)
Control Maximum control over every argument, label, and capability. Good control through a UI, but some advanced options may be limited.
Performance Slightly better performance; no extra plugin layer to load. Excellent performance; modern plugins are highly optimized.
Ease of Use Requires PHP knowledge. Steeper learning curve for beginners. Very user-friendly. No coding required, great for all skill levels.
Portability CPTs are tied to the theme or plugin where the code resides. Excellent portability; CPTs are independent of the active theme.
Maintenance Code must be maintained and updated manually. Updates are handled through the standard WordPress plugin system.
Best For Developers building custom themes, plugins, or complex applications. Designers, site builders, beginners, and projects needing rapid setup.

Ultimately, the choice boils down to a classic trade-off: convenience versus control. A plugin gets you up and running in minutes, while code gives you the ultimate power to customize and optimize. If you're new to the WordPress ecosystem and decide the plugin route is for you, our guide on how to install a plugin in WordPress is a great place to start.

Using CPT UI: The Code-Free Way to Create CPTs

If you'd rather organize your website without touching a single line of PHP, the Custom Post Type UI (CPT UI) plugin is your new best friend. It's a massively popular and free tool that gives you a simple interface for creating and managing custom post types and taxonomies, all from the comfort of your WordPress dashboard.

Think of it as the control panel for your site's entire content architecture.

The real beauty here is how accessible it makes everything. You don't need to be a developer to start structuring your content like a seasoned pro. Whether you’re a designer building a portfolio, a marketer setting up a case study library, or a business owner creating a product catalog, CPT UI makes the process visual and incredibly straightforward.

Getting It Installed and Ready to Go

First things first, you need to get the plugin on your site. The process is the same as any other WordPress plugin and should only take a moment.

  • In your WordPress dashboard, head over to Plugins → Add New.
  • Type "Custom Post Type UI" into the search bar.
  • Find the plugin—it's the one with over one million active installations—and click Install Now.
  • Once it's installed, just hit Activate.

With the plugin active, you'll spot a new "CPT UI" menu item in your sidebar. This is where the magic happens. Everything you need for building your custom content structures is neatly tucked away under this single menu.

Creating Your First Custom Post Type

Alright, let's dive in and create something practical. For this walkthrough, we'll build a "Case Studies" post type, which is a super common need for agencies, freelancers, and businesses that want to show off their work.

From your dashboard, navigate to CPT UI → Add/Edit Post Types. You'll land on a screen with a bunch of options, but don't get overwhelmed. We'll stick to the essentials to get you up and running fast.

The screen below shows you the main interface where you'll define the core details for your new content type.

Close-up of a laptop screen showing a website editor with 'Create CPTS' on a purple banner.

This whole interface is designed to be intuitive. You just fill in the fields, like the slug and labels, to register your CPT without ever needing to write code.

To get started, there are three fields you absolutely have to fill out:

  • Post Type Slug: This is the unique, URL-friendly ID for your CPT. For our example, let's use case-study. Keep in mind, this slug has to be all lowercase, have no spaces, and be 20 characters or less.
  • Plural Label: This is what you'll see in the admin menu. Go ahead and enter Case Studies.
  • Singular Label: This is for single entries, so we'll just use Case Study.

Pro Tip: You could stop there, but I strongly recommend clicking the "Populate additional labels based on chosen labels" link right below these fields. It’s a huge time-saver. It automatically fills in all the other labels (like "Add New Case Study," "Edit Case Study," etc.), saving you from a ton of tedious typing and keeping the backend experience consistent.

Configuring the Must-Have Settings

Now, just scroll down a bit to the "Settings" section. This is where you get to control how your CPT actually works. There are a lot of toggles, but here are the key ones to focus on for now:

  • Publicly Queryable: Keep this set to True. It’s what allows your case studies to be seen on the front-end of your site.
  • Show UI: Set this to True as well. This is what makes the "Case Studies" menu actually appear in your admin sidebar.
  • Has Archive: Setting this to True is crucial. It tells WordPress to create an archive page (just like a blog page) at yourdomain.com/case-study, where all your published case studies will be listed together.
  • Menu Icon: This is a nice little touch for personalization. You can pick any of the available Dashicons to give your CPT a unique icon in the sidebar, which makes it much easier to spot.

Once you’ve got those configured, just click the big Add Post Type button at the bottom. And that’s it! You'll now see "Case Studies" in your WordPress admin menu, all set for you to start adding your awesome work.

Adding a Custom Taxonomy to Stay Organized

A post type is great on its own, but its real power comes from organization. Let's create a custom taxonomy called "Service Type" so we can categorize our case studies.

Head over to CPT UI → Add/Edit Taxonomies.

Just like you did for the post type, fill in the essential details:

  • Taxonomy Slug: service-type
  • Plural Label: Service Types
  • Singular Label: Service Type

Now for the most important part: you have to link this new taxonomy to your "Case Studies" post type. Look for the "Attach to Post Type" box and simply check the box next to Case Studies.

Finally, scroll to the bottom and click Add Taxonomy. Now, when you go to add or edit a case study, you’ll find a "Service Types" box right there on the screen—just like the familiar "Categories" box for blog posts. This lets you organize your work in a way that makes perfect sense for your business.

Supercharging Your CPTs with Advanced Custom Fields

Creating a custom post type is a fantastic start, but let’s be honest—on its own, it’s just an empty container. You get the standard WordPress title and content editor, which isn't much different from a regular post. The real magic happens when you pair your CPT with a plugin like Advanced Custom Fields (ACF).

This combination is what I consider the undisputed power couple of WordPress development. Think of it this way: CPT UI builds the architectural frame (the "Case Study"), but ACF adds the custom rooms and features inside it—the "Client Name," "Project Date," and "Live Site Link" fields. Together, they let you move beyond unstructured blobs of text to create highly organized, data-rich content.

Computer screen showing WordPress editor with custom fields for client name, completion date, and live site link.

This structured approach is the foundation for building almost any kind of specialized website you can dream up, from a real estate directory to a movie review database.

Building Your First Field Group

First things first, you'll need to install and activate the free Advanced Custom Fields plugin from the WordPress repository. Once that's done, you’ll spot a new "ACF" menu item in your dashboard. Your first move is to create a Field Group, which is just a fancy name for a collection of custom fields that will appear together.

Let’s stick with our "Case Studies" CPT. We want to add specific fields to capture project details.

  1. Head over to ACF → Field Groups in your WordPress dashboard.
  2. Click the Add New button to get started.
  3. Give your field group a clear title, something like "Case Study Details."

This title is purely for your own reference in the backend, so make it descriptive. It really helps keep things organized, especially when you start juggling multiple field groups for different post types down the road.

Adding Practical Custom Fields

Now for the fun part: adding the actual fields. With your "Case Study Details" group open, click the + Add Field button. You'll be presented with a ton of options, but let's focus on creating three practical fields for our case study.

  • Client Name: For the Field Label, enter "Client Name." You'll notice ACF automatically generates the Field Name (client_name), which is perfect. Just leave the Field Type as Text.
  • Project Completion Date: Click + Add Field again. This time, label it "Project Completion Date." For the Field Type, select the Date Picker. This gives your content editors a much slicker, user-friendly calendar interface.
  • Live Site Link: Add one more field and label it "Live Site Link." For this one, change the Field Type to URL. This nifty little setting ensures that only a valid URL format can be entered, which is great for maintaining data integrity.

The key takeaway here is to always choose the right field type for the data you want to collect. Using a Date Picker instead of a plain Text field for a date doesn't just make data entry easier; it ensures the data is stored in a consistent, usable format.

This structured data is what unlocks the full potential of your content. If you're curious about how this plays out on the front-end, you can learn more about using Elementor dynamic content to pull these fields into your designs.

Linking Your Fields to the CPT

So, you've created the fields, but now you need to tell ACF where to actually show them. This is the final and most critical step in the setup.

Scroll down to the "Settings" box, which you'll find below your list of fields. Look for a section called "Location Rules." This is where you connect your shiny new Field Group directly to your CPT.

By default, it probably says something like "Show this field group if Post Type is equal to Post." Simply click that dropdown and change "Post" to our "Case Study" CPT.

Once you've set that rule, hit the Save Changes button.

Now for the moment of truth. Navigate to Case Studies → Add New. You should see your beautiful, custom-built fields waiting for you right below the main content editor. You’ve successfully broken free from the constraints of the default WordPress interface and created a truly custom editing experience.

How to Display Your Custom Content with Elementor

Alright, you’ve put in the hard work. You've registered your custom post type, mapped out all your custom fields, and started adding content. Now for the fun part: making it all look great on the front end of your site.

This is where the magic really happens. With Elementor’s Theme Builder, you can take all that structured data you created with ACF and display it beautifully—without touching a single line of code. You're not just building pages anymore; you're designing a dynamic system. You’ll create one template that automatically powers hundreds (or even thousands) of CPT entries, keeping everything consistent and ridiculously easy to update later.

Building Your Single Post Template

First up, you need a template to define how an individual entry in your CPT will look. For our "Case Studies" example, this is the page a visitor lands on when they click to view a specific project.

From your WordPress dashboard, head over to Templates → Theme Builder. This is your command center for all things template-related in Elementor.

You’ll want to create a new "Single Post" template. Elementor will immediately ask you to set its "Display Conditions," and this is the most critical step. Instead of letting this template apply to all your blog posts, you'll set a specific rule to only show it for your "Case Studies" post type.

Once you’re in the editor, you'll start building the layout with a mix of standard and dynamic widgets. The real power here is Elementor's Dynamic Tags feature. This lets you pull data directly from your custom fields into the design.

For instance, to show the client's name:

  1. Drag a Heading widget onto the canvas.
  2. Look for the small "database" icon (Dynamic Tags) next to the title field and click it.
  3. Scroll down the list and choose ACF Field.
  4. Click the wrench icon to open its settings, and from the "Key" dropdown, select your client_name field.

And just like that, the client's name for whatever case study is being viewed will pop right in. You can do this for every custom field you made—map the project_completion_date to a text widget, hook the live_site_link up to a button's URL, and so on.

This dynamic mapping is what makes CPTs and page builders such a killer combination. You design the container once, and Elementor handles the job of filling it with the right content for every single entry. It’s an incredible time-saver.

Creating a Stunning Archive Page

A single template is essential, but you also need a page to showcase all of your case studies together (like yourdomain.com/case-study). This calls for an "Archive" template.

Back in the Theme Builder, create a new "Archive" template and, just like before, set the display conditions to specifically target the "Case Studies Archive."

On this page, your go-to widgets will be ones designed to show multiple posts at once. Elementor's native Posts widget works well, but for more advanced layouts and filtering, a widget like the Dynamic Post Grid from Exclusive Addons is a fantastic choice. These let you build beautiful, customizable grids of your CPT content.

Inside the widget’s settings, you'll find a "Query" section. This is where you tell it which content to pull. Simply change the source from the default "Posts" to your "Case Studies" post type. After that, you're free to customize the number of columns, the layout, and exactly what info (like the featured image and title) appears for each item in the grid.

For anyone involved in web design e-commerce, mastering CPTs is a non-negotiable skill for managing products and displaying them in unique, compelling ways.

Why This Combination Is a Game-Changer

Using add-ons that push Elementor's capabilities even further gives development teams a serious advantage. It lets them build out portfolio items, case studies, or product listings with far more visual flair than default tools allow.

Plus, sites built with well-structured CPTs often see an SEO boost. You're creating highly organized content hubs that search engines love, making it easier to target specific keywords and organize your sitemap logically.

This entire workflow unlocks the ability to build sites that were once reserved for seasoned developers—think sophisticated directories, real estate listings, or movie review catalogs. Our complete guide on WordPress custom post types dives into even more ideas to spark your imagination. When you combine CPTs, custom fields, and a visual builder like Elementor, you gain total control over both your site’s architecture and its final look.

Got Questions About WordPress Custom Post Types?

When you first start wrangling custom post types, it's almost a guarantee you'll hit a few snags. It’s just part of the process. I've been there, and I’ve seen these same questions pop up time and time again.

This section is your cheat sheet for those "Wait, why isn't this working?" moments. Let's tackle the most common headaches so you can get back to building.

Why Am I Getting a 404 Error on My New CPT?

This is, without a doubt, the most common rite of passage for anyone creating their first CPT. You’ve written the code or configured the plugin, you hit "publish" on your first "Case Study," and when you try to view it… a big fat "Page Not Found" error.

Don't panic! The fix is almost laughably simple.

This happens because WordPress hasn't updated its internal roadmap—its "rewrite rules"—to know about the new URL structure for your CPT. You just need to give it a little nudge.

Here’s all you have to do:

  1. In your WordPress dashboard, head over to Settings → Permalinks.
  2. That's it. Don't touch a single setting. Just click the Save Changes button.

This one click forces WordPress to flush its old URL rules and recognize your shiny new post type. In 99% of cases, this will instantly fix the 404 error for both single CPT entries and their archive pages.

Should I Register CPTs in My Theme or in a Plugin?

You might be tempted to just drop the register_post_type code into your theme's functions.php file. It works, so what's the harm? Well, while it’s technically possible, it's a practice I strongly advise against.

The best way is to register your CPTs in a dedicated plugin, whether it's a tool like CPT UI or your own site-specific plugin.

The reason boils down to one crucial word: portability.

If your post type is defined in your theme, it’s completely chained to that theme. The day you decide to switch designs, your "Projects" or "Team Members" CPT—and all the content you've meticulously created—will effectively disappear from your dashboard. The data is still in the database, but WordPress no longer knows it exists.

By using a plugin, you separate your site's foundational structure (your content types) from its visual layer (your theme). This means your valuable content is always safe and accessible, no matter how many times you redesign your site.

How Can I Include CPTs in WordPress Search?

Out of the box, WordPress search is a bit picky. It only bothers to look through standard Posts and Pages. This means if a user searches for a term you know is in your "Portfolio" CPT, they'll get zero results. Not great for user experience.

Thankfully, making your custom content discoverable is easy.

If you used a plugin like CPT UI, just go back into that post type's settings. Look for an option called "Exclude From Search" and make sure it's set to False. This tells the plugin to let WordPress's native search function see your content.

For the coders out there, you'll want to check the arguments in your register_post_type function. Just make sure the exclude_from_search argument is explicitly set to false. If you want even more fine-grained control, you can dig into the pre_get_posts action hook to customize exactly which post types get included in search queries.

Can I Convert Existing Posts into a CPT?

Absolutely. This is a massive time-saver when you're reorganizing a site that's been around for a while. Let's say you've been publishing "Book Reviews" as regular blog posts for years and now you want to move them into a proper "Reviews" CPT. You don't have to copy and paste a single thing.

A fantastic free plugin called Post Type Switcher is your best friend here.

Once you install and activate it, the process couldn't be simpler:

  • Navigate to the edit screen for any post you want to move.
  • In the "Publish" box on the right-hand sidebar, you'll see a new "Post Type" dropdown.
  • Just select your shiny new CPT from the list and hit "Update."

Voilà! The post is instantly converted, keeping all its content, title, and metadata, but now it lives in its new, more organized home. This turns a potentially huge content migration job into a few simple clicks.


Ready to build stunning, dynamic layouts for your custom content without writing any code? With over 108 widgets and extensions, Exclusive Addons gives you the power to design anything you can imagine in Elementor.

Discover the full potential of Exclusive Addons today!