wp post-type <command>

Retrieves details on the site’s registered post types.

In this article

Get information on WordPress’ built-in and the site’s custom post types.


# Get details about a post type
$ wp post-type get page --fields=name,label,hierarchical --format=json

# List post types with 'post' capability type
$ wp post-type list --capability_type=post --fields=name,public
| name          | public |
| post          | 1      |
| attachment    | 1      |
| revision      |        |
| nav_menu_item |        |


wp post-type get

Gets details about a registered post type.

wp post-type list

Lists registered post types.

Command documentation is regenerated at every release. To add or update an example, please submit a pull request against the corresponding part of the codebase.