unloc/wp-cli-all-sites 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

GitHub 信息

  • Stars: 7
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-03-01

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固