Custom Post Types Made Simple

When you initially set up WordPress, you’ll find two primary content types: Posts and Pages. For a lot of websites, these options are enough.

But as your site grows, you might require a more effective method to categorize various types of content. This is where Custom Post Types become useful.

A Custom Post Type is essentially a new type of content that you can create. It works similarly to a standard post but it serves a specific purpose, complete with its own settings and a designated spot in the WordPress dashboard.

Why Not Just Use Posts?

Imagine you own a restaurant website. Besides writing blog articles, you also want to display your menu items.

You could create each menu item as a blog post, but that would quickly become confusing. Your menu would mix with your blog articles, making both harder to manage.

Instead, you could create a Custom Post Type called Menu Items. Now every dish has its own section in the dashboard, separate from your blog posts.

The same idea applies to many websites.

For example, you can create Custom Post Types for:

  • Products
  • Testimonials
  • Events
  • Recipes
  • Team Members
  • Portfolios
  • Properties for a real estate website
  • Projects

Each content type stays organized and easy to manage.

When Should You Create One?

A good rule of thumb is:

If the content has a different purpose, and should be managed separately, a Custom Post Type is the right choice.

For example, a travel website might contain blog articles, travel destinations, hotels, and travel guides. While they all contain text and images, they represent different kinds of content. Creating a Custom Post Type for each keeps the dashboard organized and makes the website easier to maintain.

Image of the dashboard left sidebar including custom post types.
Here, except from the standard post types (Pages, Posts) there are also custom post types (Tips, Testimonials, and Projects), each with its own section and dashicon.

On the other hand, if the only difference is the topic, use categories or tags instead.

For example, “Technology,” “Sports,” and “Travel” are all still blog posts. They do not need separate Custom Post Types.

Title

To set up a custom post type with custom code, you need to add the register_post_type() function to your theme’s functions.php file or, create a custom plugin for it.

This function takes two parameters: a unique identifier for your post type and an array of arguments that define how it operates.

Example of a register_post_type() function.

Keep in mind that if you use it in a theme, (functions.php), your post type might disappear from the admin area if a user changes their theme.

To ensure your changes, like the post type, remain intact regardless of theme switches, it’s advisable to use Must Use Plugins (mu-plugins). Create the plugin inside the mu-plugins designated folder that is.

Image showing the MU plugins folder inside public_html section.

Final Thoughts

Using Custom Post Types allows you to categorize content that isn’t a perfect match for traditional posts and pages.

Custom Post Types make the WordPress dashboard easier to navigate and allow each type of content to have its own templates and features.

Once your website starts handling more than simple articles and pages, they become one of the most useful tools WordPress offers.

Although my blog doesn’t support comments, feel free to reply via email or X.