17Hrs
59Mins
19Secs

50% OFF EVERYTHING ENDS TODAY!

Cyber Monday sale: 50% off with code BF2022
Buy Plugins

How to create custom post types in WordPress (step-by-step)

June 21, 2022

How to create custom post type with plugin

Every WordPress site comes with the default post and page post types. While they are sufficient for small websites, they are not ideal for large sites. This is where the WordPress custom post type comes in. In this article, I’ll lay down a step-by-step guide to creating, managing, and displaying custom post types easily.

Post Types are powerful tools that can help you better organize content on any WordPress website. They are the key differentiators that elevate WordPress from a simple blogging platform to a powerful Content Management System (CMS).

No doubt, custom post types are useful, but they can be a bit confusing to some. On top of that, custom fields and taxonomies can further complicate things for new users but don't worry. By the end of this guide, you'll have a clear understanding of WordPress custom post types, taxonomies, and fields. You'll know how to create them with the free Easy Post Types and Fields plugin, and how to display them on your website with Posts Table Pro.

preview custom post type content
A custom post type (movie reviews) displayed using Posts Table Pro.

Let’s start by answering this question.

What are WordPress custom post types?

Since WordPress is a super flexible content management system, it relies heavily on post types. Think of post types as buckets of information where website owners can store and organize their custom content. Each bucket/post type is different from others in nature and is built to serve a distinct purpose.

WordPress itself comes with a couple of default post types.

  • Page
  • Post
  • Media
  • Attachments

Post types such as page and post are set up automatically with every website, and you can use them to distinguish blog post content from web page content. Some plugins and themes also come packaged with their own post types such as the 'Product' post type that is automatically installed with WooCommerce for building eCommerce websites.

You can also create your custom post type (CPT) to organize website's custom content more strategically. For example, if you have a book review website, you can use the ‘posts’ post type to write your movie reviews, but if you want to do it efficiently, you should create a ‘Movie reviews’ post type and organize all your movie reviews there.

At Barn2, we use Knowledge Base and Showcase custom post types to keep those two content types separate from our tutorials and keep our content more organized.

To further structure the content, every custom post type can have custom taxonomies and custom fields.

Custom Taxonomies

Custom taxonomies are a way to group content together. In any custom post type, you can create custom taxonomies to group content based on their nature. For example, you can create a ‘Book Genre’ taxonomy for a book review website to bifurcate content into categories such as Thriller, Mystery, Fiction, Self-help, etc. Taxonomies can be hierarchical in nature too. For example, In the self-help section, there can be a sub-division of book reviews into categories such as biographies, health, success, etc.

Custom Fields

Custom fields on the other hand, store extra information for posts. They are different from taxonomies. Rather than helping in organizing data, they help in saving post-level data for individual content pieces or posts. For example, on the movie review website, if you want to display 'movie ratings' data, you can add a custom standard text field and add ratings for all movies individually.

custom fields wordpress

By combining different post types, fields, and taxonomies, you can smartly organize the content on your website. Let’s see the different ways you can create custom post types on your website.

How to create a WordPress custom post type

Undoubtedly, creating custom content types can significantly help you structure the content on your website. But before you start creating CPTs, plan out how you want to structure your website content.

In some cases, you can simply use the categories and tags to better manage the content on your website, but that might not be ideal for all cases. If your content is different in nature and it doesn’t make sense to place them in the same bucket as other posts or custom content pieces, then creating a CPT can actually be useful.

With that in mind, broadly, you get two alternatives to create custom post types:

  • Creating custom WordPress post types with a free plugin (for non-developers)
  • Creating custom WordPress post types with code (for developers)

Let’s take a look at both of them individually.

Creating custom WordPress post types with a free plugin (for non-developers)

You can create a custom post type with the help of a WordPress custom post type plugin. If you are not a developer, creating a custom post type with a plugin will help you to set it up in minutes. And, of course, it goes without saying, you can use a WordPress custom post type plugin to create custom post types even if you are a developer. It’s just way simpler if you use a WordPress custom post type plugin.

There are quite a few WordPress plugins that can help you create custom post types. I recommend using the free Easy Post Types and Fields plugin. It is the easiest WordPress custom post type plugin to use and create custom post types with. Even if you are new to WordPress, you can effortlessly create custom post types with the Easy Post Types and Fields plugin.

Easy post types and fields plugin

We designed the plugin after realizing the need for a simple custom post-type builder plugin on the market. While there are advanced plugins out there, we created Easy Post Types and Fields with simplicity at its core.

Not just custom post types, you can create custom taxonomies and fields with the Easy Post Types and Fields plugin.

So, without any further ado, let’s jump into the step-by-step guide and see how you can create a custom post type with the Easy Post Types and Fields plugin.

If you'd rather watch a video, you can check it here:

Installing the Easy Post Types and Fields plugin

To create custom post types, we need to first install the Easy Post Types and Fields plugin. Here’s how you can do it:

  1. In your WordPress admin dashboard, go to Plugins → Add New.
  2. If you haven’t downloaded the Easy Post Types and Fields plugin, you can download it here from wordpress.org. Click on the Upload plugin button and upload the file.
  3. Click on the Install button and once the installation is done, click on the Activate button.

Once the plugin is activated on the website, the setup wizard will be loaded automatically. The wizard will help you create a custom post type easily.

If you already have the plugin installed on your website, you can launch the wizard by going to Post Types → Manage and clicking on the Add New button.

Creating custom post type with the wizard

Firstly, you need to give your custom post type a singular and a plural name and click on the Next button. For example, if you are creating a movie reviews custom post type, the names can be:

  • Singular name: Movie Review
  • Plural name: Movie Reviews
custom post type wizard

Now select the information/attributes you need for your custom post type. Simply select the checkbox for the features you will use and click on the Create button.

And that's it! You've successfully created your first custom post type.

Wizard complete for custom post type

You can also go back and adjust these settings later and if you wish to add an option to store particular data, you can add custom fields to the post type to store information individually.

Now that you have your custom post type ready, you can locate it on your WordPress dashboard’s left sidebar navigation.

custom post type in sidebar

To make the custom content types more organized, you can add custom taxonomies to the post type. I recommend checking out this guide on creating custom WordPress taxonomies.

If you wish to add custom fields to your post type, you can do the same with the Easy Post Types and Fields plugin in no time.

To add a custom field, go to Post Types → Manage. In the Action column, click on the Custom Fields button for the respective post type. Now click on Add New and enter the details of the new custom field, such as Name, Slug, and the Field Type.

director custom post type
Adding a new custom post type, Director, for Movie Reviews post type

I added three custom fields to the Movie Reviews post type:

custom fields movies CPT

Adding content/posts to custom post type

Once you have everything set up, you can start adding and organizing content in a custom post type.

For this, in your WordPress dashboard, hover over the post type name and click on Add New. Enter the details for your post type and select the respective taxonomies to organize the content.

Repeat this process for every new post, and once you are done, you can view the posts in the custom post type by clicking on the Post Type name in the WordPress dashboard. The content/pages for the post type I created for this tutorial (Movie Reviews) look like this:

Movie reviews custom post type data

With the posts added to the custom post type, it’s time to display them on your website’s front end.

Creating custom WordPress post types with code (for developers)

Just like anything in WordPress, there’s a way to create custom WordPress post types via writing code as well. This is usually referred to as creating custom post types ‘manually’ as it requires the developers to write and inject PHP code manually to build custom post types. For this, you need to have knowledge about writing CSS and PHP code, functions.php file, API, args, etc.

Since this article is focused on non-developers, I am not going to go deep into the coding method. I recommend this useful guide by Smashing Magazine to help you create custom post types by writing code manually.

Displaying custom post types with Posts Table Pro

The Easy Post Types and Fields plugin is perfect for creating new post types, fields, and taxonomies seamlessly. But to display them you need a separate plugin that comes with options to display post types content to your website visitors.

Posts Table Pro lets you display any published website content in a structured tabular format. For example, if I want to display the data of Movie Reviews content, I can choose to create a table that only displays the content of the Movie Reviews custom post type.

Display and filter custom post type content on your website easily!

Additionally, Posts Table Pro comes with features that can help your website visitors find the content pieces they are looking for. Features such as sort, filter, search, and order can greatly help your visitors if you have lots of content on your website.

Let’s see how you can use Posts Table Pro to display your new custom post type content on your website’s front.

Installing and activating Posts Table Pro

Before you can install the plugin, you need to download it. If you don't have Posts Table pro, you can get it here.

  1. Go to Plugins → Add New in your WordPress admin dashboard.
  2. Click on the Upload button and upload the Posts Table Pro zip file and install it.
  3. Once the installation is done, click on the Activate button.
  4. Enter the license key in the plugin settings page and activate the license.
  5. The Posts Table Pro plugin is now ready to use.

Displaying custom post type data in a searchable table

To display a particular post type data with Posts Table Pro, you need to adjust the settings first. For this, go to Settings → Posts Table Pro in your WordPress Dashboard.

In the Table of Contents section, select the Post Type you want to display and enter the columns in the text field below to define the columns of the table.

You can also make other changes to the table design from the settings page. Refer to this guide to learn about the complete list of options in Posts Table Pro.

Once you’ve made the changes, click on the Save changes button at the bottom.

Now all you need to do is paste the [posts_table] shortcode on any page or post on your website. If you are using the block editor, it should look like this:

With the plugin settings I set up, this is what the posts table looks like:

preview custom post type content

Display custom field data as columns in the table.

In the table above, you must have noticed the custom fields data being displayed as columns. To display this, you simply need to add a custom fields tag cf:<field-name> with the slug in the columns field on the settings page.

For example, to display the custom fields as columns for the post type I created earlier, I need to enter the following terms: title, cf:director, cf:rating, cf:release-year

custom field columns

You can also enhance the table by adding elements such as a search box, filter options, and pagination.

You can find the options for all these features on the plugin settings page. For filters, you can add the custom taxonomy as dropdown filters too. For example, if I wish to use the Genre taxonomy as a filter, this is what the posts table would look like:

custom filters taxonomy preview

Start creating custom post types today!

Custom post types can greatly help in efficiently organizing website content. With this guide, you too can create and display custom post types content on your website effortlessly with a WordPress custom post type plugin.

The Easy Post Types and Fields plugin is the best WordPress plugin for creating new post types, fields, and taxonomies for free. With minimal settings and options, anyone can organize content in custom post types.

To display custom posts type content on the website's front end, the Posts Table Pro is the perfect tool. Apart from just listing, you can also organize, sort, filter, and granularly control what is displayed to the visitors. With the Posts Table Pro plugin, you can:

  • Display posts, pages, or any other custom post types in tabular format.
  • Show content based on custom fields and taxonomies.
  • Allow visitors to filter, sort, and perform quick searches.
  • Use shortcode flexibly to display limited data.
  • Display custom field content as table columns.
Display and filter custom post type content on your website easily!

So, what are you waiting for? Start creating custom post types with the Easy Post Types and Fields plugin and display them with Posts Table Pro on your website. If you have any questions, let us know in the comments section below!!

Please share your thoughts...

Your email address will not be published.