Implement wp site get command to enable site operations by URL#571
Open
Implement wp site get command to enable site operations by URL#571
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
… reliability Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add option to delete site using --url
Implement wp site get command to enable site operations by URL
Feb 4, 2026
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Multisite installations with custom domains couldn't easily delete sites by URL - only by ID or slug, which required manual lookup in automated workflows.
Implementation
Adds
wp site get <site>command that accepts both site IDs and full URLs:URL detection and lookup
wp_parse_url()to extract domain and pathwp_blogstable bydomainandpathfor URL-based lookupsOutput formatting
WP_CLI\Formatterwith standard format optionsblog_id,url,last_updated,registeredsite_id,domain,path,public,archived,mature,spam,deleted,lang_id--fieldparameter for single field extractionCommand registration
composer.jsoncommands listUsage
Follows the pattern established by
wp user getandwp post getfor consistency with existing commands.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
2b53fd.example.com/usr/bin/php /usr/bin/php /home/REDACTED/work/entity-command/entity-command/vendor/wp-cli/wp-cli/bin/../php/boot-fs.php core install-network --title=WP CLI Network --subdomains=1 signup h bobuser --field=active(dns block)417b4e.example.com/usr/bin/php /usr/bin/php /home/REDACTED/work/entity-command/entity-command/vendor/wp-cli/wp-cli/bin/../php/boot-fs.php core install-network --title=WP CLI Network --subdomains=1 install-network k/entity-commandfeatures/site.feature --subdomains=0 deactivate vendor/bin/wp sh vend�� site etwork /entity-command/vendor/wp-cli/wp-cli/bin/wp -cli/bin/wp create rgo/bin/sh /entity-command/vendor/wp-cli/wp-cli/bin/wp(dns block)6750df.example.com/usr/bin/php /usr/bin/php /home/REDACTED/work/entity-command/entity-command/vendor/wp-cli/wp-cli/bin/../php/boot-fs.php core install-network --title=WP CLI Network --subdomains=1 install-network vendor/bin/sh --subdomains=0 /tmp/wp-cli-test/home/REDACTED/work/entity-command/entity-command/vendor/wp-cli/wp-cli�� mposer/vendor/bisite sh vend�� l && debian-sa1 foo option mposer/vendor/bin/sh option_name --format=json sh sh(dns block)75a777.example.com/usr/bin/php /usr/bin/php /home/REDACTED/work/entity-command/entity-command/vendor/wp-cli/wp-cli/bin/../php/boot-fs.php core install-network --title=WP CLI Network --subdomains=1 features/site-create.feature /usr/local/.ghcup/bin/mysql src/User_Applicawhich list /entity-command/vendor/bin/sh ode /ent�� ith-url dirname(dns block)de6696.example.com/usr/bin/php /usr/bin/php /home/REDACTED/work/entity-command/entity-command/vendor/wp-cli/wp-cli/bin/../php/boot-fs.php core install-network --title=WP CLI Network --subdomains=1 _Command.php cal/bin/bash site.*url foreSuiteTested.--version cal/bin/grep grep -l site.*url ./src/Network_Namespace.php mposer/vendor/bin/git site.*url n_Command.php /usr/bin/grep grep(dns block)example.com/usr/bin/php /usr/bin/php /home/REDACTED/work/entity-command/entity-command/vendor/wp-cli/wp-cli/bin/../php/boot-fs.php core install --url=REDACTED --title=WP CLI Site --admin_user=admin --admin_email=admin@example.com --admin_password=password1 --skip-email ep grep ehat�� function url vendor/wp-cli/wp-cli/bundle/rmccue/requests/src/Exception/Http/Status431.php /home/REDACTED/.local/bin/grep site url\|site_ush siteCommand.php /home/REDACTED/.cocore grep(dns block)/usr/bin/php /usr/bin/php /home/REDACTED/work/entity-command/entity-command/vendor/wp-cli/wp-cli/bin/../php/boot-fs.php core install --url=REDACTED --title=WP CLI Site --admin_user=admin --admin_email=admin@example.com --admin_password=password1 --skip-email rep grep -l site.*url _Command.php nfig/composer/vefeatures/site.feature site.*url foreSuiteTested.--version nfig/composer/vendor/bin/grep grep(dns block)/usr/bin/php /usr/bin/php /home/REDACTED/work/entity-command/entity-command/vendor/wp-cli/wp-cli/bin/../php/boot-fs.php core install --url=REDACTED --title=WP CLI Site --admin_user=admin --admin_email=admin@example.com --admin_password=password1 --skip-email cal/bin/sh sh vend�� 8375422c2c24.700--tags=~@less-than-wp-6.6&&~@less-than-wp-5.1&&~@less-than-wp-6.8&&~@less-than-psh install-network ndor/bin/sh --subdomains=0 1 /usr/local/.ghcup/bin/sh sh(dns block)wp-cli.org/usr/bin/curl curl -sSL REDACTED sh -cli�� /entity-command/vendor/wp-cli/wpbobuser ( "bobuser", "bobuser@example.com" ); vendor/bin/wp --fields=signup_sh --format=csv p/bin/sh sh /ent�� user signup vendor/bin/sh --fields=signup_sh active --per_page=1 sh(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.