WordPress is a popular tool for building websites. It is user-friendly and flexible. Many people use it to create blogs, business sites, and more.
One of WordPress’s great features is custom post types. Custom post types allow you to create different types of content. These types can be different from the standard posts and pages. Let’s learn how to create custom post types in WordPress.
What are Custom Post Types?
Custom post types are different content types. They help you organize your content better. For example, you may want to create a custom post type for “Books” or “Recipes”. This way, you can keep your content neat and organized.

Credit: toolset.com
Why Use Custom Post Types?
Custom post types offer many benefits. Here are a few:
- Better content organization
- Improved user experience
- More control over your content
Steps to Create Custom Post Types
Creating custom post types is easy. Follow these steps:
Step 1: Install And Activate A Plugin
The easiest way to create custom post types is by using a plugin. There are many plugins available. One popular plugin is “Custom Post Type UI”.
To install this plugin:
- Go to your WordPress dashboard.
- Click on “Plugins” > “Add New”.
- Search for “Custom Post Type UI”.
- Click “Install Now” and then “Activate”.
Step 2: Create A New Custom Post Type
Now that the plugin is active, you can create a new custom post type.
To create a custom post type:
- Go to “CPT UI” in your dashboard.
- Click on “Add/Edit Post Types”.
- Fill in the necessary fields:
Field | Description |
---|---|
Post Type Slug | A unique name for your post type. Use lowercase letters and underscores. |
Plural Label | The name for your post type in plural form. |
Singular Label | The name for your post type in singular form. |
Once you have filled in these fields, click “Add Post Type”.
Step 3: Customize Your Post Type
Now you can customize your post type. There are many options you can set. Here are a few important ones:
- Has Archive: Enable if you want an archive page for this post type.
- Public: Make this post type visible to everyone.
- Show in Menu: Display this post type in your admin menu.
Adjust these settings as needed. Then, click “Save Post Type”.
Step 4: Add Content To Your Custom Post Type
Now you can add content to your custom post type. To do this:
- Go to your WordPress dashboard.
- Find your new custom post type in the menu.
- Click “Add New”.
- Enter your content and click “Publish”.
Using Custom Post Types in Your Theme
To display your custom post types, you may need to edit your theme. This can be a bit more advanced. Here is a simple example:
php
// Custom Query for Custom Post Type
$args = array(
'post_type' = 'your_post_type_slug',
'posts_per_page' => 10
);
$custom_query = new WP_Query($args);
if ($custom_query->have_posts()) :
while ($custom_query->have_posts()) : $custom_query->the_post();
// Your custom display code here
endwhile;
wp_reset_postdata();
endif;
?>
Replace your_post_type_slug
with your actual post type slug. Add this code to your theme’s template files. This will display your custom post types on your site.

Credit: www.wpbeginner.com
Frequently Asked Questions
What Are Custom Post Types In WordPress?
Custom post types are unique content types. They go beyond posts and pages.
Why Use Custom Post Types?
They help organize content better. They make the website user-friendly.
How To Create Custom Post Types?
Use a plugin like Custom Post Type UI. Or code it manually.
Can I Create Custom Post Types Without A Plugin?
Yes, you can. Use the `register_post_type()` function in your theme’s `functions. php` file.
Conclusion
Creating custom post types in WordPress is easy. It helps you organize your content better. Follow the steps above to create your own custom post types. Enjoy the flexibility and control it offers.
Remember, always back up your site before making changes. This will keep your content safe.