If you’re a WordPress developer or just someone who likes to dabble in customizing your site, then you’ve probably heard about custom post types.
Custom post types allow you to create your own content type in WordPress, which can be really useful for things like advanced web projects, WordPress themes, etc.
In this guide, we’ll show you how to create and use custom post types in WordPress. We’ll also give you some tips on how to make the most of them. So if you’re ready to take your WordPress development skills up a notch, keep reading!
- What is a Post Type in WordPress?
- What are Third-Party Post Types for WordPress?
- What are Custom Post Types for WordPress?
- How to create Custom Post Types in WordPress?
- Best Free Custom Post Type WordPress Plugins
What is a Post Type in WordPress?
WordPress is an amazing tool for creating and maintaining websites, but what’s even more impressive are all the different types of content it can host. WordPress comes loaded with a few post types that you might commonly use such as blog posts or pages; they’re stored in your database under wp_posts table!
WordPress includes various post types such as Posts, Pages, Attachments, Revisions, Navigation Menus, Custom CSS, and Changesets.
In this guide, we will only be discussing the most common default options, which are Posts and Pages.
What exactly is the Post Type called Posts?
Posts in WordPress are called pieces of content which can be anything from an article or blog post to pictures you want to share on Twitter, Facebook, or LinkedIn!
Posts are displayed in reverse sequential order by time, meaning newer posts come before older ones on your blog. The latest posts are also available via an automatic feed called Really Simple Syndication (RSS) Feed.
So now let’s take a look at what exactly is the Post Type called Pages?
Pages are similar to posts, but they have some important differences. Pages do not appear in reverse sequential order and can be placed into a hierarchical ranking system where one page is the parent of another creating what’s called page structure. Pages also don’t use categories and tags like a regular blog post would.
The default post types within WordPress may be sufficient for most users, but if you’re looking for ways to extend the number of available post types on your WordPress site to have more control, then you may want to consider creating Custom Post Types to better serve and organize your website.
But before we show you how to add new custom post types, in the next section we will cover some examples of post types that are not available by default but can be easily added using popular WordPress plugins without learning to code.
What are Third-Party Post Types for WordPress?
Here are just a few examples of third-party Post Types that are not included with default WordPress installation, but are commonly used and can be easily added using a WordPress plugin or sometimes even a WordPress theme.
For example, to make your eCommerce website more functional and engaging, it is important to add a product post type. The easiest way of doing this would be installing the WooCommerce plugin, which can give you all that necessary functionality for an online store without costing anything extra!
Similarly, when selling digital goods like software licenses or graphic templates to download on your website you’ll want a post type called ‘Downloads’ or ‘Digital Products’ which can be added using our Easy Digital Downloads plugin.
With the help of plugins and themes, you can even create your own classified post type to list items like homes or cars. Similarly, properties could be listed on Real Estate websites with their appropriate plugin in use!
What are Custom Post Types in WordPress?
Custom Post Types are a great way to create your own type of content for your websites. In this section, we will learn what custom post types actually are and their benefits as well as some options that you can use when creating one!
When you have to go beyond the default available post types, such as Posts and Pages, or even third-party post types like Products using the WooCommerce plugin to build a website for a specific niche or industry, you have to turn to Custom Post Types.
Imagine you have a requirement to create a movie database like IMDB, then you must create a CPT called Movies.
Similarly, based on your need you could create custom post types such as listings, events, and products. According to WPBeginner, they use custom post types for their “Deals” sections to keep them separate from the daily blog articles. It helps them better organize the website content.
To create a new custom post type you have two options. The easy option requires no coding, while the other requires some coding knowledge.
Unless you are a developer or learning to code, I recommend going with no coding option. As it will be easy, quick, and have fewer chances of breaking your website.
The no-coding option is installing a WordPress plugin. There are both free and paid options available based on what you need for your website.
How to create Custom Post Types in WordPress with a Plugin?
Let’s assume that we have a requirement to create a reviews website like IMDB to list movies from all different genres, so we must create a new Custom Post Type called Movies.
First, download and install the Free CubeWP add-on, then go to Custom Post Types under the CubeWP menu option and click Add New.
Start by filling out the basic details such as slug, name, and description for the Movies CPT.
QUICK TIP:
The slug is recommended to always be in the plural to have the best result.
Lastly, you have additional 15+ options to choose from as per your requirement. For example, you can choose if this custom post type will be made Public in WordPress admin or not.
Once you click the Create button, you can see the new Movies Custom Post Type is displayed in the WordPress Main Navigation on the left.
Similarly, you can create a custom post type based on your project requirements, for example, Events for an events booking website, Ad Listing for a classified website, or Properties for a real estate website.
How to create Custom Post Types in WordPress without a Plugin?
Creating custom post types in WordPress is a simple process if you don’t mind writing a few lines of code and adding it to your theme’s functions.php file or to a site-specific plugin. Here is a step-by-step guide on how to create a custom post type in WordPress:
1. Add Custom Fields
- Open your WordPress theme’s functions.php file or create a site-specific plugin if you prefer to keep your custom code separate from your theme.
- Add the following code to register a custom post type:
function create_custom_post_type() {
$labels = array(
'name' => 'Custom Post Type',
'singular_name' => 'Custom Post Type',
'add_new' => 'Add New',
'add_new_item' => 'Add New Custom Post Type',
'edit_item' => 'Edit Custom Post Type',
'new_item' => 'New Custom Post Type',
'view_item' => 'View Custom Post Type',
'search_items' => 'Search Custom Post Types',
'not_found' => 'No custom post types found',
'not_found_in_trash' => 'No custom post types found in Trash',
'parent_item_colon' => 'Parent Custom Post Type:',
'menu_name' => 'Custom Post Types',
);
$args = array(
'labels' => $labels,
'hierarchical' => false,
'description' => 'Custom post type description',
'supports' => array('title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'custom-fields'),
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 5,
'show_in_admin_bar' => true,
'show_in_nav_menus' => true,
'can_export' => true,
'has_archive' => true,
'exclude_from_search' => false,
'publicly_queryable' => true,
'capability_type' => 'page',
);
register_post_type('custom_post_type', $args);
}
add_action('init', 'create_custom_post_type'); - Replace ‘Custom Post Type’ and ‘custom_post_type’ with your desired post type name. Make sure to use a unique post type name, as post type names must be unique within the WordPress installation.
- Customize the other arguments as needed. The $labels array contains the labels for your custom post type, and the $args array contains other options for your custom post type, such as whether it supports certain features (e.g., title, editor, comments) and whether it is public or private.
- Save the changes to your functions.php file or site-specific plugin.
- Visit the WordPress admin area and go to the ‘Custom Post Types’ menu to create and manage your custom post types.
- I hope this helps! Let me know if you have any questions or need further assistance.
2. Display Custom Fields on the Frontend
To display the custom fields for a custom post type on the frontend of your WordPress site, you can use the get_post_meta() function in your theme’s template file. Here is an example of how you can display a custom field called ‘field_name’ for a post:
Open the template file for the post type where you want to display the custom field. For example, if you want to display the custom field on a single post of the ‘custom_post_type’ post type, you would open the single-custom_post_type.php template file.
Inside the template file, use the following code to retrieve and display the value of the ‘field_name’ custom field:
$value = get_post_meta(get_the_ID(), 'field_name', true);
if (!empty($value)) {
echo $value;
}
?>
This code retrieves the value of the ‘field_name’ custom field for the current post and echoes it to the screen if it is not empty.
You can use this same method to display multiple custom fields for a post. Just add additional calls to get_post_meta() and customize the field name and display output as needed.
I hope this helps! Let me know if you have any questions or need further assistance.
Best Free Custom Post Type WordPress Plugins
Here are some hand-picked free Custom Post Type plugins for you after reviewing several different plugins and data points. Which includes when the plugin was released, percentage of the active downloads vs total downloads, reviews & ratings, when was the plugin last updated, and most importantly the utility of the plugin.
#5. WordPress Creation Kit
WordPress Creation Kit was released by Cozmos Labs in 2013.
It has crossed a total of 450,000 downloads in 9 years but currently has over 20,000 active users which means only 4.5% of users are still using it after downloading and installing it.
Currently, the plugin has a very good rating of 4.7 out of 5 based on more than 95 reviews.
WordPress Creation Kit lets you create custom post types for free without having to install additional plugins.
It’s not just a custom post type plugin but it can also help you create custom taxonomies, custom fields, and meta boxes for your posts, pages, etc
#4. MB Custom Post Types & Taxonomies
MB Custom Post Types & Custom Taxonomies was released by Metabox in 2015.
This particular extension for Metabox has crossed a total of 100,000 downloads in 10 years and is active on more than 6,000 websites which means only 6% of users are still using it after downloading and installing it.
Currently, the plugin has a good rating of 4.6 out of 5 based on more than 10 reviews.
This is an extension for Metabox, which is one of the most popular plugins for custom meta boxes and custom fields in WordPress.
#3. Pods Framework
Pods Framework was released in 2008.
This is one of the most popular free plugins to create a dynamic content website.
It has crossed a total of 2.5 Million downloads in 10 years and is currently active on over 100,000 websites.
It has an excellent rating of 4.9 out of 5 based on more than 365 reviews.
Pods is a powerful Custom Content Types and Fields plugin that also lets you create content types such as custom taxonomies, custom fields, etc.
#2. Custom Post Type UI
Custom Post Type UI was released by WebDevStudios in 2012. It has crossed a total of over 11 Million downloads in 10 years but is currently active on over 1 Million websites which means about 10% of users are still using it after downloading and installing it.
Currently, the plugin has a rating of 4.7 out of 5 based on more than 250 reviews.
Custom Post Type UI plugin will let you only create custom post types and custom taxonomies.
#1 Post Types Unlimited
Finally, the winner is Post Types Unlimited was released by WPExplorer in 2019.
It had over 10,000 total downloads in 3 years and is currently active on over 3,000 websites, which means about 30% of users are still using it.
Even though the total number is quite low, relatively this has the highest active installs for Custom Post Types exclusively.
The plugin has a rating of 5 out of 5 based on 7 reviews. Post Types Unlimited plugin also lets you only create a custom post type and custom taxonomies.
So if you are on a budget and need a free plugin to create custom post types and custom taxonomy without coding then you should definitely check out #1 and #2.
If you also need to create custom fields and other custom content types, then go with #3, #4, or #5 based on your need. One thing you also need to consider when picking these plugins is how they enable displaying data on the front-end.
Some might require you to write code and others might ask you to purchase an extended version.
The stats in this video was gathered from WordPress.org
Let us know what you think about our selection of these plugins and how would you rank them.
If there are other free custom post type plugins that you recommend please let us know in the comments below.
Conclusion
By now you should have a good understanding of what post types are and how to create custom post types in WordPress. You may be wondering which is the best Custom Post Type WordPress Plugin? The answer to that question depends on your specific needs, but we recommend checking out CubeWP Framework – it’s our favorite plugin for creating custom post types and taxonomies! Thanks for reading our Ultimate Guide to Custom Post Types in WordPress.