ZeroToWP

Post Type

Quick Definition

A post type is a category of content in WordPress. The built-in post types are Posts, Pages, Attachments, Revisions, and Navigation Menu Items. You can also create custom post types for any kind of content.

WordPress Post Types documentation in the Plugin Handbook on developer.wordpress.org

What Is a Post Type?

A post type defines a type of content in WordPress. When you create a blog post, you are using the "post" post type. When you create a static page, you are using the "page" post type. They are different types of content with different behaviors, but WordPress stores them all in the same database table (wp_posts) — the post_type column tells WordPress which type each entry is.

WordPress comes with several built-in post types:

  • Post (post) — Blog content displayed in reverse chronological order. Has categories, tags, and feeds. This is what most people think of when they hear "WordPress content."
  • Page (page) — Static, hierarchical content outside the blog feed. Pages can have parent-child relationships (like About > Team > Contact) but do not use categories or tags.
  • Attachment (attachment) — Metadata for uploaded media files (images, videos, PDFs). Every file in your Media Library is an attachment post type behind the scenes.
  • Revision (revision) — Automatic version history of your posts and pages. Every time you save, WordPress creates a revision so you can roll back changes.
  • Navigation Menu Item (nav_menu_item) — Each link in a WordPress menu is stored as this post type.

There are also internal post types you rarely interact with directly: custom_css (stores Customizer CSS) and customize_changeset (stores Customizer draft changes).

The real power comes from custom post types. WordPress lets developers register entirely new content types using register_post_type(). Common examples include:

  • Products — WooCommerce registers a product post type
  • Portfolio — Showcase projects separate from blog posts
  • Testimonials — Client reviews managed as structured content
  • Events — Calendar entries with dates and locations
  • Properties — Real estate listings with custom fields

Each custom post type can have its own taxonomies, templates, and admin interface — making WordPress flexible enough to handle virtually any kind of content, not just blog posts and pages.

Post Types in Practice

Understanding post types changes how you think about WordPress. A "post" is not just a blog article — it is any piece of content stored in the wp_posts table. When a plugin adds "Portfolio" or "Testimonials" to your admin sidebar, it has registered a custom post type. When a theme displays products in a grid, it is querying the product post type.

You can check what post types are registered on your site using WP-CLI: wp post-type list shows every registered post type with its label, public status, and whether it is built-in or custom.

Why It Matters

Post types are the backbone of WordPress's content architecture. Every piece of content — blog posts, pages, media, menus, WooCommerce products — is a post type. Understanding this system helps you choose the right plugins, structure your site logically, and build custom solutions when the defaults are not enough.

Sources

Related Terms

Related Articles