unloc/wp-cli-all-sites
最新稳定版本:1.0.0
Composer 安装命令:
composer require unloc/wp-cli-all-sites
包简介
Run any WP-CLI command across all sites in a multisite network
README 文档
README
Run any WP-CLI command across every site in a WordPress multisite network.
No more piping wp site list through xargs. Just add --all-sites to any command and it runs on every site in the network, with progress tracking, error handling, and site exclusion built in.
Requirements
- PHP 8.2+
- WP-CLI 2.5+
- WordPress multisite installation
Installation
wp package install unloc/wp-cli-all-sites
WP-CLI versions before 2.13 cannot resolve Packagist packages due to a bug in package-command. Use the git URL instead:
wp package install https://github.com/unlocnl/wp-cli-all-sites.git
Usage
Add --all-sites to any WP-CLI command to run it on every site in the network.
wp option get blogname --all-sites
Flags
| Flag | Description |
|---|---|
--all-sites |
Run the command on every site in the network |
--continue-on-error |
Don't stop on first site failure |
--except=<list> |
Comma-separated URLs or blog IDs to skip |
Destructive commands (site delete, site empty, site archive, etc.) prompt for confirmation. Pass --yes to skip the prompt.
Sub-commands run with stdin detached, so interactive prompts in the underlying command won't work. Pass --yes or equivalent flags to bypass them.
Examples
# Get blogname for all sites
wp option get blogname --all-sites
# Run on all sites except shop
wp cache flush --all-sites --except=shop.example.com
# Exclude by blog ID
wp cache flush --all-sites --except=3,7
# Continue even if a site fails
wp plugin list --all-sites --continue-on-error
# Run cron for all sites
wp cron event run --due-now --all-sites --continue-on-error
# Destructive: requires --yes
wp site empty --all-sites --yes
License
MIT
统计信息
- 总下载量: 12
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 7
- 点击次数: 5
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-03-01