@@ -3150,7 +3150,7 @@ wp post get <id> [--field=<field>] [--fields=<fields>] [--format=<format>]
31503150Gets a list of posts.
31513151
31523152~~~
3153- wp post list [--<field>=<value>] [--p=<id>|ID] [--title=<title>|post_title] [--name=<slug>|post_name] [--author=<author>|post_author] [--author_name=<author_name>] [--post_type=<post_type>] [--post_status=<post_status>] [--post_parent=<post_parent>] [--post_mime_type=<post_mime_type>] [--menu_order=<menu_order>] [--comment_status=<comment_status>] [--ping_status=<ping_status>] [--comment_count=<comment_count>] [--s=<string>] [--year=<year>] [--monthnum=<monthnum>] [--day=<day>] [--m=<yearmonth>] [--w=<week>] [--field=<field>] [--fields=<fields>] [--format=<format>]
3153+ wp post list [--<field>=<value>] [--p=<id>|ID] [--title=<title>|post_title] [--name=<slug>|post_name] [--author=<author>|post_author] [--author_name=<author_name>] [--cat=<cat>] [--category_name=<category_name>] [--tag=<tag>] [--post_type=<post_type>] [--post_status=<post_status>] [--post_parent=<post_parent>] [--post_mime_type=<post_mime_type>] [--menu_order=<menu_order>] [--comment_status=<comment_status>] [--ping_status=<ping_status>] [--comment_count=<comment_count>] [--s=<string>] [--year=<year>] [--monthnum=<monthnum>] [--day=<day>] [--hour=<hour>] [--minute=<minute>] [--second=<second>] [--m=<yearmonth>] [--w=<week>] [--meta_key=<meta_key>] [--meta_value=<meta_value>] [--orderby=<orderby>] [--order=<order>] [--post__in=<ids>] [--post__not_in=<ids>] [--post_name__in=<slugs>] [--post_parent__in=<ids>] [--post_parent__not_in=<ids>] [--author__in=<ids>] [--author__not_in=<ids>] [--category__in=<ids>] [--category__and=<ids>] [--category__not_in=<ids>] [--tag_id=<tag_id>] [--tag__in=<ids>] [--tag__and=<ids>] [--tag__not_in=<ids>] [--tag_slug__in=<slugs>] [--tag_slug__and=<slugs>] [--page_id=<page_id>] [--pagename=<pagename>] [--attachment_id=<attachment_id>] [--date_query=<json>] [--meta_query=<json>] [--tax_query=<json>] [--meta_compare=<meta_compare>] [--sentence=<sentence>] [--exact=<exact>] [--search_columns=<columns>] [--perm=<perm>] [--posts_per_page=<number>] [--paged=<paged>] [--offset=<offset>] [--nopaging=<nopaging>] [--field=<field>] [--fields=<fields>] [--format=<format>]
31543154~~~
31553155
31563156Display posts based on all arguments supported by [ WP_Query()] ( https://developer.wordpress.org/reference/classes/wp_query/ ) .
@@ -3186,6 +3186,17 @@ Only shows post types marked as post by default.
31863186 [--author_name=<author_name>]
31873187 Filter by the 'user_nicename' of the post's author.
31883188
3189+ [--cat=<cat>]
3190+ Filter by category ID. Accepts a comma-separated list to match any of
3191+ them, and a negative ID excludes that category instead.
3192+
3193+ [--category_name=<category_name>]
3194+ Filter by category slug.
3195+
3196+ [--tag=<tag>]
3197+ Filter by tag slug. Accepts a comma-separated list to match any of them,
3198+ or a '+'-separated list to require all of them.
3199+
31893200 [--post_type=<post_type>]
31903201 Filter by post type. Defaults to 'post'. Accepts a comma-separated list,
31913202 or 'any' for every type registered without 'exclude_from_search'.
@@ -3225,12 +3236,137 @@ Only shows post types marked as post by default.
32253236 [--day=<day>]
32263237 Filter by day of the month, 1 to 31.
32273238
3239+ [--hour=<hour>]
3240+ Filter by hour, 0 to 23.
3241+
3242+ [--minute=<minute>]
3243+ Filter by minute, 0 to 59.
3244+
3245+ [--second=<second>]
3246+ Filter by second, 0 to 59.
3247+
32283248 [--m=<yearmonth>]
32293249 Filter by year and month together, e.g. 202401.
32303250
32313251 [--w=<week>]
32323252 Filter by week of the year, 0 to 53.
32333253
3254+ [--meta_key=<meta_key>]
3255+ Filter by posts having this meta key. Pair it with `--meta_value` to
3256+ filter on the value as well.
3257+
3258+ [--meta_value=<meta_value>]
3259+ Filter by this meta value. Needs `--meta_key` to say which key it
3260+ belongs to.
3261+
3262+ [--orderby=<orderby>]
3263+ Order the results by this field. Accepts what WP_Query accepts, e.g.
3264+ 'date', 'title', 'ID', 'menu_order', 'rand', or 'meta_value' alongside
3265+ `--meta_key`.
3266+
3267+ [--order=<order>]
3268+ Direction to order by. Accepts 'ASC' or 'DESC'.
3269+
3270+ [--post__in=<ids>]
3271+ Only list the posts with these IDs (comma-separated).
3272+
3273+ [--post__not_in=<ids>]
3274+ Exclude the posts with these IDs (comma-separated).
3275+
3276+ [--post_name__in=<slugs>]
3277+ Only list the posts with these slugs (comma-separated). Unlike `--name`
3278+ this is not a single-post query, so it reaches drafts as well.
3279+
3280+ [--post_parent__in=<ids>]
3281+ Only list the posts whose parent is one of these IDs (comma-separated).
3282+
3283+ [--post_parent__not_in=<ids>]
3284+ Exclude the posts whose parent is one of these IDs (comma-separated).
3285+
3286+ [--author__in=<ids>]
3287+ Only list the posts by these author IDs (comma-separated).
3288+
3289+ [--author__not_in=<ids>]
3290+ Exclude the posts by these author IDs (comma-separated).
3291+
3292+ [--category__in=<ids>]
3293+ Only list the posts in these category IDs (comma-separated).
3294+
3295+ [--category__and=<ids>]
3296+ Only list the posts in all of these category IDs (comma-separated).
3297+
3298+ [--category__not_in=<ids>]
3299+ Exclude the posts in these category IDs (comma-separated).
3300+
3301+ [--tag_id=<tag_id>]
3302+ Filter by tag ID.
3303+
3304+ [--tag__in=<ids>]
3305+ Only list the posts with these tag IDs (comma-separated).
3306+
3307+ [--tag__and=<ids>]
3308+ Only list the posts with all of these tag IDs (comma-separated).
3309+
3310+ [--tag__not_in=<ids>]
3311+ Exclude the posts with these tag IDs (comma-separated).
3312+
3313+ [--tag_slug__in=<slugs>]
3314+ Only list the posts with these tag slugs (comma-separated).
3315+
3316+ [--tag_slug__and=<slugs>]
3317+ Only list the posts with all of these tag slugs (comma-separated).
3318+
3319+ [--page_id=<page_id>]
3320+ Filter by page ID. Needs `--post_type=page` to match anything.
3321+
3322+ [--pagename=<pagename>]
3323+ Filter by page slug. Needs `--post_type=page` to match anything.
3324+
3325+ [--attachment_id=<attachment_id>]
3326+ Filter by attachment ID. Needs `--post_type=attachment` to match
3327+ anything.
3328+
3329+ [--date_query=<json>]
3330+ Filter by a date query, given as JSON. See WP_Date_Query.
3331+
3332+ [--meta_query=<json>]
3333+ Filter by a meta query, given as JSON. See WP_Meta_Query.
3334+
3335+ [--tax_query=<json>]
3336+ Filter by a taxonomy query, given as JSON. See WP_Tax_Query.
3337+
3338+ [--meta_compare=<meta_compare>]
3339+ Operator to test `--meta_value` with, e.g. '=', '!=', '>' or 'LIKE'.
3340+
3341+ [--sentence=<sentence>]
3342+ Match `--s` as one phrase rather than as separate words. Accepts 1 or 0.
3343+
3344+ [--exact=<exact>]
3345+ Match `--s` against the whole column rather than part of it. Accepts 1
3346+ or 0.
3347+
3348+ [--search_columns=<columns>]
3349+ Comma-separated list of columns `--s` looks in. Accepts 'post_title',
3350+ 'post_excerpt' and 'post_content'. Needs WordPress 6.2 or later.
3351+
3352+ [--perm=<perm>]
3353+ Filter by what the current user may do with the post. Accepts
3354+ 'readable' or 'editable'; pair it with the global `--user` argument,
3355+ since WP-CLI is no user by default.
3356+
3357+ [--posts_per_page=<number>]
3358+ How many posts to return. Defaults to -1, meaning every post.
3359+
3360+ [--paged=<paged>]
3361+ Which page of results to return, counted in `--posts_per_page` steps.
3362+
3363+ [--offset=<offset>]
3364+ How many posts to skip. Needs `--posts_per_page` set to something other
3365+ than -1, which otherwise takes precedence.
3366+
3367+ [--nopaging=<nopaging>]
3368+ Return every post, ignoring `--posts_per_page`. Accepts 1 or 0.
3369+
32343370 [--field=<field>]
32353371 Prints the value of a single field for each post.
32363372
0 commit comments