Custom Post Types in WordPress: A Beginner’s Guide

4 min read

Get this guide as a PDF FREE

Save it, print it or read it offline.

Custom post types in WordPress for beginners

This post may contain affiliate links. If you buy through them, I may earn a commission at no extra cost to you.

A custom post type is a new kind of content in WordPress, alongside the built-in posts and pages. For example, a site could add “Reviews”, “Recipes” or “Products”, each with its own admin menu and its own archive. Custom post types are registered with the register_post_type() function, usually in a plugin. This beginner’s guide explains when they are useful, how they work and the simplest ways to add them.

WordPress starts with two main content types: posts for dated articles and pages for static content. For many blogs, that is all you need.

But if you publish a different kind of content repeatedly, such as tool reviews, recipes or case studies, keeping it separate can make your site easier to manage and browse.

Key takeaways

  • Custom post types are extra content types beyond posts and pages.
  • Each one gets its own menu in the WordPress dashboard.
  • Developers register them with register_post_type(), usually on the init hook.
  • WordPress recommends registering them in a plugin, not a theme.
  • Non-developers can use a plugin with a settings screen.
  • Most small blogs do not need them. Categories are often enough.

Built-in content types vs custom post types

TypeGood forExample
PostDated articles, part of the blog feedHow to write a blog post title
PageStatic contentAbout, Contact, Privacy Policy
Custom post typeA repeated, distinct kind of contentReviews, Recipes, Courses, Portfolio items

When a custom post type makes sense

  • You publish a distinct type of content with its own layout or fields.
  • You want it separate from your main blog feed.
  • You want its own archive page, such as yoursite.com/reviews/.

If your “different” content is really just a group of blog posts, a category is usually simpler. My guide on categories vs tags explains how to organise posts.

How custom post types are registered

WordPress’s developer documentation explains that a custom post type is registered with the register_post_type() function. Key points from the docs:

  • Call it on the init hook.
  • The post type key must be 20 characters or fewer.
  • Prefix the key to avoid clashes with other plugins, and do not start it with “wp_”.
  • WordPress recommends putting custom post types in a plugin rather than a theme, so your content stays available if you change themes.

Why a plugin and not the theme?

If a custom post type is registered by your theme and you switch themes, the content still exists in the database, but you lose access to it in the dashboard until it is registered again. A plugin keeps it independent of the theme.

Ways to add a custom post type

  1. Use a plugin with a settings screen. Several free plugins let you create custom post types without code. Choose a well-maintained one with recent updates.
  2. Use a small custom plugin. A developer can write a short plugin that calls register_post_type() on the init hook.
  3. Check your theme or page builder. Some already include custom post types for portfolios or testimonials.

After adding a new post type, if its pages show a 404 error, go to Settings, then Permalinks, and click Save Changes. This refreshes WordPress’s URL rules. My guide on WordPress permalinks explains that screen.

Custom post types and SEO

  • Give the post type a clear, readable URL base, such as /reviews/.
  • Make sure its posts are included in your sitemap. Most SEO plugins let you choose which post types to include.
  • Add internal links between the custom content and related blog posts.
  • Use the right structured data where it fits. See schema markup explained.

Before you start

  • Back up your site first. See how to back up WordPress.
  • Plan the name and URL base carefully. Changing them later can break links.
  • Consider whether the block editor supports the content you want. My block editor guide covers the basics.

Frequently asked questions

What is a custom post type in WordPress?

A content type you add alongside posts and pages, such as Reviews or Recipes, with its own dashboard menu.

Do I need custom post types for my blog?

Most small blogs do not. Categories are often enough to organise posts.

How do I create a custom post type without code?

Use a well-maintained plugin that lets you create post types from a settings screen.

Should I register custom post types in my theme?

WordPress recommends a plugin instead, so your content stays accessible if you change themes.

Why does my custom post type show a 404 error?

Go to Settings, then Permalinks, and click Save Changes to refresh the URL rules.

Share

Written by Nayan Dhumal

I’m a blogger and graphic designer. I’ve been blogging for 3 years and I run several sites, including a free SEO tools website. I also sell printable digital products on Gumroad. Here I share what I actually learn while doing it: what ranks, what earns and what wastes your time.

Leave a Reply

Your email address will not be published. Required fields are marked *

Some links on this site are affiliate links. If you buy through them, I may earn a commission at no extra cost to you. I only recommend tools I’d use myself.