Count WordPress plugins by status
how many wordpress plugins are inactive | parse wp-cli output with jq | count plugins by status wp-cli | jq | wp-cli | wordpress | jsonwp plugin list --format=json --path=/var/www/vhosts/example.com/httpdocs | jq -r 'group_by(.status)[] | "\(.[0].status): \(length)"'Fetches the plugin list as JSON, groups it by the status field with group_by and prints the status and count for each group. The result looks like active: 14 and inactive: 6. Many inactive plugins are a candidate for cleanup, since deactivated code can still be vulnerable.
Note: The same pattern works with .update instead of .status to count available updates. Run it as the subscription’s system user.
Also searched as
- how many wordpress plugins are inactive
- parse wp-cli output with jq
- count plugins by status wp-cli