@@ -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>] [--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>] [--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>]
31543154~~~
31553155
31563156Display posts based on all arguments supported by [ WP_Query()] ( https://developer.wordpress.org/reference/classes/wp_query/ ) .
@@ -3159,7 +3159,77 @@ Only shows post types marked as post by default.
31593159** OPTIONS**
31603160
31613161 [--<field>=<value>]
3162- One or more args to pass to WP_Query.
3162+ One or more args to pass to WP_Query. The arguments below are the ones
3163+ that filter on what this command displays; anything else WP_Query accepts
3164+ still works and is documented with WP_Query itself.
3165+
3166+ [--p=<id>|ID]
3167+ Filter by post ID. `--ID` is the name of the column this filters and is
3168+ accepted as an alias.
3169+
3170+ [--title=<title>|post_title]
3171+ Filter by post title, matched in full. `--post_title` is the name of the
3172+ column this filters and is accepted as an alias.
3173+
3174+ [--name=<slug>|post_name]
3175+ Filter by post slug. `--post_name` is the name of the column this filters
3176+ and is accepted as an alias.
3177+ Note: this makes the query a single-post one, and WP_Query returns a draft
3178+ from one of those only to a user who can edit it. WP-CLI runs as no user
3179+ unless the global `--user` argument says otherwise, so pass that to filter
3180+ drafts by slug.
3181+
3182+ [--author=<author>|post_author]
3183+ Filter by the ID of the post's author. `--post_author` is the name of the
3184+ column this filters and is accepted as an alias.
3185+
3186+ [--author_name=<author_name>]
3187+ Filter by the 'user_nicename' of the post's author.
3188+
3189+ [--post_type=<post_type>]
3190+ Filter by post type. Defaults to 'post'. Accepts a comma-separated list,
3191+ or 'any' for every type registered without 'exclude_from_search'.
3192+
3193+ [--post_status=<post_status>]
3194+ Filter by post status. Defaults to 'any', which is every status
3195+ registered without 'exclude_from_search' - so trashed and auto-draft posts
3196+ are left out until asked for by name, e.g. `--post_status=trash`.
3197+
3198+ [--post_parent=<post_parent>]
3199+ Filter by the ID of the parent post.
3200+
3201+ [--post_mime_type=<post_mime_type>]
3202+ Filter by MIME type. Only attachments carry one.
3203+
3204+ [--menu_order=<menu_order>]
3205+ Filter by menu order.
3206+
3207+ [--comment_status=<comment_status>]
3208+ Filter by comment status. Accepts 'open' or 'closed'.
3209+
3210+ [--ping_status=<ping_status>]
3211+ Filter by ping status. Accepts 'open' or 'closed'.
3212+
3213+ [--comment_count=<comment_count>]
3214+ Filter by number of comments.
3215+
3216+ [--s=<string>]
3217+ Only list the posts matching this search term.
3218+
3219+ [--year=<year>]
3220+ Filter by four-digit year, e.g. 2024.
3221+
3222+ [--monthnum=<monthnum>]
3223+ Filter by month number, 1 to 12.
3224+
3225+ [--day=<day>]
3226+ Filter by day of the month, 1 to 31.
3227+
3228+ [--m=<yearmonth>]
3229+ Filter by year and month together, e.g. 202401.
3230+
3231+ [--w=<week>]
3232+ Filter by week of the year, 0 to 53.
31633233
31643234 [--field=<field>]
31653235 Prints the value of a single field for each post.
@@ -5443,41 +5513,60 @@ These fields are optionally available:
54435513Lists all sites in a multisite installation.
54445514
54455515~~~
5446- wp site list [--network=<id>] [--<field>=<value>] [--site__in=<value>] [--site_user=<value>] [--site-path=<path>] [--blog_id=<blog_id>] [--site_id=<site_id>] [--domain=<domain>] [--registered=<date>] [--last_updated=<date>] [--public=<public>] [--archived=<archived>] [--mature=<mature>] [--spam=<spam>] [--deleted=<deleted>] [--lang_id=<lang_id>] [--field=<field>] [--fields=<fields>] [--format=<format>]
5516+ wp site list [--network=<id>|site_id|network_id] [--<field>=<value>] [--site__in=<value>] [--site__not_in=<value>] [--site_user=<value>] [--site-path=<path>] [--path__in=<value>] [--path__not_in=<value>] [--blog_id=<blog_id>|ID] [--network__in=<value>] [--network__not_in=<value>] [--domain=<domain>] [--domain__in=<value>] [--domain__not_in=<value>] [--registered=<date>] [--last_updated=<date>] [--public=<public>] [--archived=<archived>] [--mature=<mature>] [--spam=<spam>] [--deleted=<deleted>] [--lang_id=<lang_id>] [--lang__in=<value>] [--lang__not_in=<value>] [--search=<string>] [--search_columns=<columns>] [--meta_key=<meta_key>] [--meta_value=<meta_value>] [--meta_compare=<meta_compare>] [--meta_type=<meta_type>] [--meta_query=<meta_query>] [--date_query=<date_query>] [--number=<number>] [--offset=<offset>] [--no_found_rows=<no_found_rows>] [--update_site_cache=<update_site_cache>] [--update_site_meta_cache=<update_site_meta_cache>] [--orderby=<field>] [--order=<order>] [--field=<field>] [--fields=<fields>] [--format=<format>]
54475517~~~
54485518
54495519** OPTIONS**
54505520
5451- [--network=<id>]
5452- The network to which the sites belong.
5521+ [--network=<id>|site_id|network_id]
5522+ The network to which the sites belong. `--site_id` is the name of the
5523+ column this filters, `--network_id` is WP_Site_Query's name for it, and
5524+ both are accepted as aliases. `--network` wins when more than one is given.
54535525
54545526 [--<field>=<value>]
54555527 Filter by one or more fields (see "Available Fields" section), or pass any
5456- other argument accepted by WP_Site_Query, such as 'search', 'site__not_in',
5457- 'number', 'offset', 'orderby' or 'order'. However, 'url' isn't an available
5528+ other argument accepted by WP_Site_Query. However, 'url' isn't an available
54585529 filter, as it comes from 'home' in wp_options.
54595530 Note: '--path' conflicts with the global parameter of the same name; use
54605531 '--site-path' to filter by path instead.
54615532
54625533 [--site__in=<value>]
54635534 Only list the sites with these blog_id values (comma-separated).
54645535
5536+ [--site__not_in=<value>]
5537+ Exclude the sites with these blog_id values (comma-separated).
5538+
54655539 [--site_user=<value>]
54665540 Only list the sites with this user.
54675541
54685542 [--site-path=<path>]
54695543 Filter by path. Avoids conflict with the global `--path` parameter.
54705544
5471- [--blog_id=<blog_id >]
5472- Filter by site ID .
5545+ [--path__in=<value >]
5546+ Only list the sites with these paths (comma-separated) .
54735547
5474- [--site_id=<site_id>]
5475- Filter by the ID of the network the site belongs to. `--network` is an
5476- alias for this, and takes precedence when both are given.
5548+ [--path__not_in=<value>]
5549+ Exclude the sites with these paths (comma-separated).
5550+
5551+ [--blog_id=<blog_id>|ID]
5552+ Filter by site ID. `--ID` is WP_Site_Query's name for the same filter
5553+ and is accepted as an alias.
5554+
5555+ [--network__in=<value>]
5556+ Only list the sites belonging to these network IDs (comma-separated).
5557+
5558+ [--network__not_in=<value>]
5559+ Exclude the sites belonging to these network IDs (comma-separated).
54775560
54785561 [--domain=<domain>]
54795562 Filter by domain.
54805563
5564+ [--domain__in=<value>]
5565+ Only list the sites with these domains (comma-separated).
5566+
5567+ [--domain__not_in=<value>]
5568+ Exclude the sites with these domains (comma-separated).
5569+
54815570 [--registered=<date>]
54825571 Filter by the date the site was registered. Accepts a timestamp or a
54835572 date; a value carrying no time of day matches that whole day.
@@ -5504,6 +5593,72 @@ wp site list [--network=<id>] [--<field>=<value>] [--site__in=<value>] [--site_u
55045593 [--lang_id=<lang_id>]
55055594 Filter by language ID.
55065595
5596+ [--lang__in=<value>]
5597+ Only list the sites with these language IDs (comma-separated).
5598+
5599+ [--lang__not_in=<value>]
5600+ Exclude the sites with these language IDs (comma-separated).
5601+
5602+ [--search=<string>]
5603+ Only list the sites matching this search term. Searches the domain and
5604+ path columns unless `--search_columns` narrows it.
5605+
5606+ [--search_columns=<columns>]
5607+ Comma-separated list of columns `--search` looks in. Accepts 'domain'
5608+ and 'path'.
5609+
5610+ [--meta_key=<meta_key>]
5611+ Filter by this site meta key. The site meta arguments need WordPress 5.1
5612+ or later, which is where multisite gained the table they read.
5613+
5614+ [--meta_value=<meta_value>]
5615+ Filter by this site meta value. Used together with `--meta_key`.
5616+
5617+ [--meta_compare=<meta_compare>]
5618+ Operator to test the meta value against. Accepts the operators
5619+ WP_Meta_Query supports, such as '=', '!=', 'LIKE' or 'IN'.
5620+
5621+ [--meta_type=<meta_type>]
5622+ Cast the meta value to this type, such as 'NUMERIC' or 'DATE'.
5623+
5624+ [--meta_query=<meta_query>]
5625+ A WP_Meta_Query clause list, as JSON, for conditions the meta_* arguments
5626+ above cannot express.
5627+
5628+ [--date_query=<date_query>]
5629+ A WP_Date_Query clause list, as JSON, for ranges `--registered` and
5630+ `--last_updated` cannot express. Giving those as well narrows this further
5631+ rather than replacing it.
5632+
5633+ [--number=<number>]
5634+ Limit the number of sites returned.
5635+
5636+ [--offset=<offset>]
5637+ Number of sites to skip. Used together with `--number`.
5638+
5639+ [--no_found_rows=<no_found_rows>]
5640+ Whether to skip counting the total rows the query matches. Accepts 1 or 0.
5641+
5642+ [--update_site_cache=<update_site_cache>]
5643+ Whether to prime the object cache with the sites found. Accepts 1 or 0.
5644+ Turning it off saves work when listing a large network once.
5645+
5646+ [--update_site_meta_cache=<update_site_meta_cache>]
5647+ Whether to prime the object cache with the site meta of the sites found.
5648+ Accepts 1 or 0.
5649+
5650+ [--orderby=<field>]
5651+ Order the results by this field, such as 'blog_id', 'domain', 'path',
5652+ 'registered', 'last_updated' or 'site__in'.
5653+
5654+ [--order=<order>]
5655+ Whether to order the results ascending or descending.
5656+ ---
5657+ options:
5658+ - asc
5659+ - desc
5660+ ---
5661+
55075662 [--field=<field>]
55085663 Prints the value of a single field for each site.
55095664
0 commit comments