+34 646 925 946

Get a Proposal
How to Create Custom Post Types in WordPress

How to Create Custom Post Types in WordPress

If you want to develop a Programmatic SEO website on WordPress, you will definitely need to have custom post types in order to have your Programmatic SEO pages in a separate custom post tab, and you don’t want to mix them with other pages such as posts or pages.

Fortunately, WordPress is an open-source website platform with loads of plugins, and you can even do it manually without coding. In today’s tutorial, I will show you step by step how to create custom post types using plugins or manually by inserting code.

What is CPT in WordPress (Custom Post Types)

Using CPTs on WordPress provides you with more flexibility in creating custom tabs where you can organize your custom pages. For instance, if you’re constructing a directory website and want separate post types for each category, you’ll need to create multiple custom posts. For instance, in a real estate directory, you may want apartments, houses, studios, garages, etc., each in its own tab. Then, you’ll design a content template specifically for each custom post type.

Furthermore, you can incorporate other post types like news, authors, projects, portfolios, or any other custom post type. Additionally, you can implement taxonomies within these post types. For example, for apartments, you could have taxonomies for sizes, number of bedrooms, or price ranges.

WordPress, being an open-source CMS, allows you to have personalized custom post types tailored to your needs. This flexibility and feature-rich environment cater to your audience’s diverse requirements, enhancing their user experience.

Why not create pSEO on the pages or posts tabs?

If you’re creating your Programmatic SEO pages within the Default Pages tab, and when you design your content template, you set a rule to have it specifically for those pages, then all other pages’ formatting will be the same as your Programmatic SEO pages.

This includes pages like Contact Us, About, Privacy policies, and other legal pages, as well as pages depending on your niche. Thus, it’s better to have your Programmatic SEO pages in a separate tab rather than mixing them with pages responsible for other functions to make it easier for you to internlink your pSEO pages in bulk or make edits.

However, for posts, if you want to create Programmatic articles using AI or a template and have them in the same tab as normal articles, you can do so. But you’ll need a content template specifically for these pages, not for all tabs. This way, your other articles will maintain their own layout, while your Programmatic SEO articles will have their distinct format.

Create Custom Post Types in WordPress

The easiest way to create custom post types in WordPress is by using a plugin that handles the creation of these custom tabs and their features. There are numerous plugins available, both free and paid, and we’ll explore the best options for implementing this feature.

#1 Custom Post Type UI

Custom Post Type UI

To install and activate the plugin CustomPostTypeUI, a free tool that enables you to design custom post types in seconds, follow these steps:

  1. Go to the “Plugins” section in your WordPress dashboard.
  2. Click on “Add New” and search for “Custom Post Type UI.”
  3. Install and activate the plugin.
  4. Navigate to the “CPT-UI” tab.
  5. Click on “Add New Post Type.”
  6. Define the slug, plural label, and singular label for your custom post type, then click “Add Post Type.”

To access additional features:

  1. Scroll down and select any desired features under the “Settings” tab. For instance, you can toggle the hierarchy setting between true and false.
  2. You can also set the plugin’s custom post type icon and its default display position. For instance, you can assign it a number, such as 1, to display it at the top of your WordPress tab on the left.
  3. Furthermore, you can configure the post type’s supports, such as categories, tags, products, authors, and more.

Additionally, you can define taxonomies within the post types. For example, if you’re creating a directory website in the real estate niche, you could establish taxonomies such as apartments, houses, garages, villas, etc.

#2 Pods – Custom Content Types and Fields

Pods – Custom Content Types and Fields

The Pods plugin for WordPress allows users to extend and add anything in WordPress. With Pods, users can create their own custom post type, allowing them to store unique data. This can be useful for clients who want specific features on their website, such as press releases, recipes, or house listings.

The Pods plugin is easy to install and activate, and provides all the necessary tools to get started upon activation. This includes the ability to create custom post types, customize labels, and access advanced options.

One of the key features of this plugin, the Advanced Options, allows users to customize the appearance of their custom post type in the admin area. Users can change the menu icon, menu position, and enable the REST API, which allows the custom post type to be accessed by other applications.

Another useful feature is the ability to customize the admin UI. This can be particularly helpful for clients, as it allows the creation of a more user-friendly dashboard for managing their content. Users can also store articles in categories like normal posts, or create multiple categories unique to each custom post type.

The Pods plugin also supports exporting the structure of a custom post type, making it easy to move between different websites. This is especially useful for developers who need to maintain consistent site structures across multiple projects

#3 Manually Using WPCode

WPCode

If you’d like to add your CPTs manually, you’ll need to insert code within your WordPress CMS. To do so, you could utilize plugins such as WP Code. Install and activate the plugin, then add a new snippet. Ensure that the code type is set as a PHP snippet, and paste the following code.

// Our custom post type function
function create_posttype() {
  
    register_post_type( 'movies',
    // CPT Options
        array(
            'labels' => array(
                'name' => __( 'Movies' ),
                'singular_name' => __( 'Movie' )
            ),
            'public' => true,
            'has_archive' => true,
            'rewrite' => array('slug' => 'movies'),
            'show_in_rest' => true,
  
        )
    );
}
// Hooking up our function to theme setup
add_action( 'init', 'create_posttype' );

You can name it anything. In our case, we’ll be demonstrating the custom post type as “Movies.” Click activate and save. Upon saving, you’ll notice a new tab appearing to the left in the menu named “Movies.”

New CPT created

To summarize, in this tutorial, you have learned how to create custom post types using plugins or manually through code. These custom post types can be utilized for your programmatic SEO projects, providing a separate tab for each of your programmatic SEO layouts. For example, when designing your content template and importing data in bulk, you will need to select the dataset to be imported into your specific custom post type that represents a category.

Leave a Comment