When Do You Need a Custom Post Type or Taxonomy in WordPress?

Custom post types and taxonomies can extend WordPress beyond its standard features. If you use them the right way, they can help organize your site more effectively.

That said, they might not always be necessary, and you may be wondering if you should use them.

At WPBeginner, we structure our content using custom post types and taxonomies to make navigation easier for our users. So, we are very familiar with these features and know how to use them to optimize a website.

This guide will help you understand when to use custom post types and taxonomies and how to maximize these features.

When do you need a custom post type or taxonomy in WordPress?

What Are Custom Post Types in WordPress?

Custom post types are similar to other content types like posts and pages. A post type refers to any type of content you create on your website.

WordPress comes with a few different post types by default:

  • Post
  • Page
  • Attachment
  • Revision
  • Nav Menu
  • Block templates (Patterns)
  • Templates

Note: There are several other content types used by WordPress behind the scenes to provide different features, such as custom CSS, customize changeset, template parts, oEmbed cache, and more.

Post types help distinguish between different content types in WordPress. Posts and pages are both post types, but they serve different purposes.

You can also create your own post types, known as custom post types. These are useful when creating content that has a different format than a standard post or page.

For example, if you run a book review WordPress website, then you will probably want to create a book review post type. This post type can even have different custom fields and a unique category structure.

We use custom post types at WPBeginner on our Deals, Solution Center, and Glossary pages.

Custom post type coupons page example

A lot of popular WordPress plugins already use custom post types to store data on your WordPress website. Here are a few examples:

  • WooCommerce – Adds a ‘product’ custom post type to your WordPress site.
  • WPForms – Creates a ‘wpforms’ post type to store all your forms.
  • MemberPress – Adds a ‘memberpressproduct’ custom post type.

WordPress eCommerce plugins, directory plugins, real estate plugins, recipe plugins, and others also use custom post types and taxonomies for sorting content.

For more details, see our guide on how to create custom post types in WordPress.

What Are Taxonomies in WordPress?

Taxonomies are used to group posts and custom post types.

There are two taxonomies included in WordPress: categories and tags. These are useful for standard blog posts, but they may not be as suitable when you start to use custom post types.

For example, you can create a custom post type called ‘Books’ and sort it with a custom taxonomy called ‘Genre.’

Then, you can add different genres, such as Fantasy, Horror, Romance, Self-Help, and more. This lets you and your readers quickly sort books based on their genre preferences.

Taxonomies sorting example

For more details, see our guide on how to create custom taxonomies in WordPress.

How Do You Know When You Need a Custom Post Type or Taxonomy?

You can theoretically add any type of content in WordPress posts and sort them with categories and tags, but sometimes this is not ideal.

Below are some signs that might suggest you should probably consider creating a custom post type, custom taxonomy, or both:

  1. Some of the content you post just doesn’t look or feel like a post, such as our blogging coupons page.
  2. Your content doesn’t need to be part of a chronological series of entries, like our WordPress glossary section.
  3. Categories and tags won’t help you group and sort that particular content, such as the specific sections in our coupons area.
  4. You need additional fields to enter more information with your content. For instance, our WordPress Solution Center has different sections with custom fields.
  5. It cannot be part of your pages. For example, our Blueprint page is simply a page with several subpages.
  6. You need to display that particular content differently than posts or pages.

Now, let’s look at another real-life example. Suppose you run a movie review website where you publish movie reviews and other kinds of movie-related content.

Let’s say your movie reviews have been very popular with your audience, so you want to make them better and easier to navigate. You can improve them by adding star ratings and making them searchable by actor names, genre, and more.

In this case, you will need to create a custom post type for movie reviews and then add a custom taxonomy for sorting between actors and genres.

This allows your visitors to easily browse through your movie reviews instead of every post on your WordPress blog.

Another typical example is for creatives like photographers and graphic designers creating portfolios.

If you simply share your work in a blog post, it’s easy to get lost in the rest of your content. By creating a separate portfolio custom post type, your visitors can easily browse through all of your work.

Portfolio custom post type example

If you have various categories of work in your portfolio, then you can also create a custom taxonomy for each type of portfolio project.

Additional Resources

Are you new to extending WordPress with custom taxonomies and post types? At WPBeginner, we have been helping WordPress beginners for the past 16 years.

In our experience, the following are some of the most useful resources for managing custom post types and taxonomies in WordPress:

  • How to convert categories to custom taxonomies in WordPress – If you have been using categories incorrectly and want to convert them into a custom taxonomy, this tutorial will show you how to do that.
  • How to add categories to a custom post type in WordPress – This tutorial shows how to use the default categories with any custom post type in WordPress.
  • Most useful WordPress custom post types tutorials – A compilation of tutorials on using custom post types in WordPress

We hope this article helped you understand when to use custom post types or taxonomies in WordPress. You may also want to see our beginner’s guide on switching or converting custom post types or check out these useful custom post type tutorials for additional tips.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Lượt xem: 20

Trả lời

Email của bạn sẽ không được hiển thị công khai. Các trường bắt buộc được đánh dấu *