wp_get_post_types: list supported post types
Lists the public post types on this site and what each supports. The orientation call for any content job on a site you do not already know.
Arguments
None.
Permissions
mcp:read and wp:content:read. Read-only.
What it returns
An items list. Each entry carries:
| Field | Meaning |
|---|---|
name |
The internal post type key |
label |
The human name |
rest_base |
Its REST base |
supports |
Which features it supports |
Only public types appear
The list is public post types. A non-public type is invisible here and unreachable through every other content tool.
That makes this the definitive answer to "what content can MCP touch on this site". If a post type is not in this list, no tool in chapter 12 will operate on it.
supports is the field to read
It tells you what a post type actually has, and therefore which arguments are meaningful for it:
| Support | Implies |
|---|---|
title |
The title argument applies |
editor |
The content argument applies |
excerpt |
The excerpt argument applies |
thumbnail |
A featured image can be set |
custom-fields |
Post meta is in use |
comments |
Comment tools apply |
revisions |
Content changes are recoverable |
The revisions entry matters for recovery planning: a post type without revision support has no automatic history, so a content overwrite is only recoverable from a backup or from values you recorded. See Recover from a failed write.
The thumbnail entry answers whether wp_set_featured_image will do anything for that type.
Custom post types from POM Theme
On a POM site, custom post types are often created through the theme's content model. They appear here like any other public type once registered.
If a type you expect is missing, the content model may not have been applied, or the type may be registered as non-public. See Configure POM Theme settings.
Using it well
List the post types and tell me which support revisions and featured images.
What custom post types exist on this site?
At the start of an unfamiliar job:
List the post types, then count the posts of each, then stop.
That gives you the shape of the site's content in two read calls, before agreeing to anything.
What it does not do
- It does not list taxonomies. See
wp_get_taxonomies. - It does not count posts. See
wp_count_posts. - It does not create post types. That is
pom_theme_configure_content_model, a theme tool with a different gate. - It does not show non-public types, by design.
Common problems
| Symptom | Cause |
|---|---|
| A known post type is missing | It is registered as non-public |
Only post, page and attachment |
The site has no custom types, or the theme's content model is not applied |
A type has no editor support |
Content arguments will not apply to it |