File tree Expand file tree Collapse file tree 1 file changed +75
-0
lines changed
Expand file tree Collapse file tree 1 file changed +75
-0
lines changed Original file line number Diff line number Diff line change @@ -4803,6 +4803,81 @@ WP_CLI::add_hook( 'after_invoke:site empty', function(){
48034803
48044804
48054805
4806+ ### wp site get
4807+
4808+ Gets details about a site in a multisite installation.
4809+
4810+ ~~~
4811+ wp site get <site> [--field=<field>] [--fields=<fields>] [--format=<format>]
4812+ ~~~
4813+
4814+ ** OPTIONS**
4815+
4816+ <site>
4817+ Site ID or URL of the site to get. For subdirectory sites, use the full URL (e.g., http://example.com/subdir/).
4818+
4819+ [--field=<field>]
4820+ Instead of returning the whole site, returns the value of a single field.
4821+
4822+ [--fields=<fields>]
4823+ Limit the output to specific fields. Defaults to all fields.
4824+
4825+ [--format=<format>]
4826+ Render output in a particular format.
4827+ ---
4828+ default: table
4829+ options:
4830+ - table
4831+ - csv
4832+ - json
4833+ - yaml
4834+ ---
4835+
4836+ ** AVAILABLE FIELDS**
4837+
4838+ These fields will be displayed by default for the site:
4839+
4840+ * blog_id
4841+ * url
4842+ * last_updated
4843+ * registered
4844+
4845+ These fields are optionally available:
4846+
4847+ * site_id
4848+ * domain
4849+ * path
4850+ * public
4851+ * archived
4852+ * mature
4853+ * spam
4854+ * deleted
4855+ * lang_id
4856+
4857+ ** EXAMPLES**
4858+
4859+ # Get site by ID
4860+ $ wp site get 1
4861+ +---------+-------------------------+---------------------+---------------------+
4862+ | blog_id | url | last_updated | registered |
4863+ +---------+-------------------------+---------------------+---------------------+
4864+ | 1 | http://example.com/ | 2025-01-01 12:00:00 | 2025-01-01 12:00:00 |
4865+ +---------+-------------------------+---------------------+---------------------+
4866+
4867+ # Get site URL by site ID
4868+ $ wp site get 1 --field=url
4869+ http://example.com/
4870+
4871+ # Get site ID by URL
4872+ $ wp site get http://example.com/subdir/ --field=blog_id
4873+ 2
4874+
4875+ # Delete a site by URL
4876+ $ wp site delete $(wp site get http://example.com/subdir/ --field=blog_id) --yes
4877+ Success: The site at 'http://example.com/subdir/' was deleted.
4878+
4879+
4880+
48064881### wp site list
48074882
48084883Lists all sites in a multisite installation.
You can’t perform that action at this time.
0 commit comments