How to Create Custom Post Types in WordPress?

Contributor, Benzinga

WordPress is a great platform for bloggers because it offers a handful of built-in content types such as pages, posts, media, and navigation menus. However, if you want to include a more diverse array of content types like client testimonials, product portfolios, or product descriptions, you may find the default content types on WordPress somewhat restrictive.

Thankfully, a feature known as Custom Post Type offers an intuitive and flexible way to generate even more kinds of content to better suit the needs of your website. Let’s take a closer look at what the Custom Post Type plugin entails, how it works and how you can use this plugin to create different post types on WordPress. 

What is Custom Post Type in WordPress? 

While you can definitely make use of the pre-built post types on WordPress, you might want to expand beyond the generic options and create more advanced post types. For example, let’s say you run a product review site. 

If you create a product review post type, the Custom Post Type plugin can make it possible for you to implement custom fields like rating widgets or collapsible sections with a custom category structure in your post. These customized post types can also make your website more professional while also allowing you to reuse the post type in the future for additional content.

So, a custom post type is quite similar to a template that you can customize. The Custom Post Type feature lets you customize your WordPress posts on a whole new level. Be it a uniquely placed menu, searchable content, access-driven content, or viewer comments, custom post types allow you to fully personalize your content. 

The Custom Post Type plugin converts a regular WordPress content management system (CMS) into an advanced CMS. The feature does this by grouping your posts into categories and classifying your content in a more seamless manner. 

How Does Custom Post In WordPress Work? 

A custom post has more extended functionality than a standard WordPress post and the Custom Post Type plugin makes it possible for you to reuse your content. Let’s visit the example above again. 

Say you want to test out new power banks and publish reviews regularly. When putting together your reviews, you will need to incorporate numerous elements about the power banks including prices, overall ratings, affiliate websites, videos, and images. 

Were you to use a regular WordPress post for reviews, your audience might struggle to differentiate between your regular blog posts and your reviews. Moreover, a review post could use several elements that a standard post lacks. Without a custom post, you will have to add these elements every time you create a review post. 

The Custom Post Type plugin lets you define layouts, custom fields, and templates. Posts like these also allow you to change the structures and templates of your posts all from one place. Plus, you’ll be able to enforce consistency and add a professional look to your content.

But the Custom Post Type plugin is only one of two ways that you can expand and customize your post types. Let’s take a look at the two most popular ways of creating custom post types in WordPress! 

Steps to Create Custom Post Types In WordPress

WordPress supports an endless number of custom post types. In this article, we will illustrate the two main ways that make it possible to create a custom post. You can choose to employ the approach that suits you best. 

Create custom post types with plugins

As we’ve already mentioned, you can get started with custom post types by using a plugin. This method is convenient for users who are unfamiliar with coding. Plugins let you create numerous custom post types in just a few minutes all without needing any technical know-how. 

This approach is more straightforward. Plus, it’s the faster of the two processes because plugins don’t require in-depth technical knowledge. To get started, install a plugin that creates custom post types and start publishing content right away. Some of the plugins that let you create custom post types include Pods, Toolset Types, Custom Post Type UI, and Custom Post Type Maker. 

Most of these plugins will require you to follow steps very similar to these:

  1. Log in to your WordPress Dashboard.
  2. Navigate to Plugin from the left sidebar.
  3. Click on the Add New option.
  4. Search for Custom Post Types Plugins using the search bar.
  5. Choose the plugin that you like best. 
  6. Click on the Install Now button to begin the installation process.
  7. After the plugin is officially installed, click on the Activate button.
  8. From there, start creating new custom posts! 

While the step-by-step process above demonstrates how you can install and activate the plugin of your choice, the steps below will show you how to create a custom post type using the Custom Post Type UI plugin. It is a free WordPress plugin that has a very simple interface and allows you to create both custom post types and custom taxonomies. 

  1. Navigate to the Custom Post Type UI menu from the left sidebar.
  2. From there, click on Add New.
  3. Enter the URL slug and name of your custom post type.
  4. Click on Edit additional labels to assign attributes and controls to your post type.
  5. Add custom taxonomies like tags and categories.
  6. Once done, click on Add Post Type.

In the left sidebar, you should see a newly created menu for every available custom post type within the plugin itself. Click on the menu and start selecting new post types to add to your website. Then, update the slug, name, and description of your new post type before creating the content and publishing your custom post type.

Create Custom Post Types in WordPress Manually

Plugins are the quickest way to create custom post types in WordPress. However, they aren’t the only option, and they come with their own set of disadvantages as well. For example, when you uninstall the plugin, your custom post types will disappear. 

Not only that, but once the posts disappear, the data will be difficult to access, making plugins a temporary solution for custom post types. Instead of risking this loss of data, you can opt-out of plugins and choose to create custom post types manually instead. 

If you want greater control over your content, the manual method of making custom post types is a much better approach. Though the manual approach of setting up custom posts type is more of a technical process, you can integrate a wide array of features within your custom post types and taxonomies. 

A manually created custom post type lets you add features like maps, micro-interactions, and widgets. To manually create a custom post type in WordPress, you will have to add a code snippet to your theme’s functions.php file. We will tell you all about how you can achieve this down below. 

Important: functions.php is a core WordPress file. Before you start modifying your files, make sure you have saved a copy of the most recent backup of your website.

  1. Locate your functions.php file.
  2. Open this file in the code editor.
  3. Add the following code to your functions.php file.
/* Custom Post Type Start */
// Creates Product Reviews Custom Post Type
function product_reviews_init() {
    $args = array(
      ‘label’ => Product Reviews’,
        ‘public’ => true,
        ‘show_ui’ => true,
        ‘capability_type’ => ‘post’,
        ‘hierarchical’ => false,
        ‘rewrite’ => array(‘slug’ => product-reviews’),
        ‘query_var’ => true,
        ‘menu_icon’ => ‘dashicons-video-alt’,
        ‘supports’ => array(
            ‘title’,
            ‘editor’,
            ‘excerpt’,
            ‘trackbacks’,
            ‘custom-fields’,
            ‘comments’,
            ‘revisions’,
            ‘thumbnail’,
            ‘author’,
            ‘page-attributes’,)
        );
    register_post_type( product-reviews’, $args );
}
add_action( ‘init’, product_reviews_init’ );*
/* Custom Post Type End */
  1. Save the functions.php file.

After adding this code to your functions.php file, Product Reviews will register as a new post type in the left sidebar of your WordPress Dashboard. Follow the steps above to manually create as many custom post types as you want.

Create Custom Post Types for Your Unique Content Needs

The Custom Post Types feature in WordPress is a go-to add-on for people looking to elevate their websites with a full-fledged content management system. You can employ this feature to build a versatile and modular website. 

If you are a beginner with no hands-on experience in coding, plugins are the best way to create custom posts. However, if you understand WordPress and have some coding knowledge, you can add a few lines of code in the core files of your WordPress website to create more dynamic posts. 

Employ the power of customization to engage your current clients and enhance your overall reach with the Custom Post Types WordPress feature!