How are you all doing? I hope you have spent a good time of the first month of this year. I have a plan for this 2020. I am a WordPressian but I didn’t use WordPress professionally. This year I am planning to engage myself in WP more and hopefully professionally. Let’s see.
I am writing here about the most confusing term in WP. If you use WP then you’ve probably come across terms like custom post types and custom taxonomies. As a beginner, you may have asked yourself when do I need to use a custom post type or custom taxonomy in WordPress? In this article, I am gonna explain why and when do you need a custom post type or taxonomy in WordPress.
What are Post Types and Taxonomies?
Post Types is a term used to refer to different types of content in a WordPress site. Practically, it should be called content type.
WordPress comes with five default post types. Posts are one of the post type just like pages, attachments, navigation menus, and revisions. All of them are stored in the posts database table and are differentiated by a column called post_type.
Post types are the way to distinguish different content types in WordPress. For example, Post and Pages are both post types, but they are made to serve a different purpose.
Taxonomy in WordPress is one of those things that everyone use, but they do not know that they are using it. WordPress taxonomies are used as a way to group posts and custom post types together.
WordPress comes with two default Taxonomies, categories and tags. However, in some cases, you may want to expand beyond categories and tags. WordPress allows you to create your own custom taxonomies and use them in your post types to group and sort your content.
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 which will indicate that you should probably consider creating a custom post type, custom taxonomy, or maybe both:
- Some content just doesn’t look and feel like a post.
- It does not need to be part of a chronological series of entries.
- Categories and Tags don’t help you group and sort that particular content.
- You need additional fields to enter more information with your content.
- It cannot be part of your pages.
- You need to display that particular content differently than posts or pages.
Let’s take a look at a real-life example. Suppose that you run a blog where you regularly publish movie reviews among other things. Perhaps you want to add extra features to your movie reviews such as add ratings, make it searchable by actor names, genre etc. This is when you will need to create a custom post type for movie reviews, and you will add custom taxonomy for sorting between genres and actors.
Another popular example would be creating a portfolio. If you’re an artist sharing your work in your blog post, then it can easily get lost. Creating a separate portfolio post type will allow your users to easily browse through all of your work.
I think you got an idea of Custom Post Type and Taxonomy.
Thanks and see you soon.