WP-CLI Plugin Commands
Plugin commands handle everything related to WordPress plugins — installing from the repository or a ZIP file, activating, deactivating, updating, and auditing what’s installed.
These are among the most frequently used WP-CLI commands in daily development work.
Commands
wp plugin list
Lists all installed plugins with status, version, and available updates.
wp plugin list
wp plugin list --status=active
wp plugin list --status=inactive
wp plugin list --format=json
Use --status to filter by active or inactive. Use --format=json to pipe output into scripts. Useful for auditing environments before updates or deployments.
wp plugin install
Installs a plugin from the WordPress.org repository, a ZIP file, or a remote URL.
wp plugin install contact-form-7
wp plugin install contact-form-7 --activate
wp plugin install /path/to/plugin.zip
wp plugin install https://example.com/plugin.zip
wp plugin install contact-form-7 --version=5.7.0
--activate installs and activates in one step. Use a ZIP path or URL for premium or private plugins. --version pins a specific release — useful when you need to match a tested version across environments.
wp plugin activate
Activates one or more installed plugins.
wp plugin activate akismet
wp plugin activate akismet contact-form-7 woocommerce
wp plugin activate --all
Multiple plugin slugs in one command. --all activates everything that’s installed — commonly used when resetting a staging environment.
wp plugin deactivate
Deactivates one or more plugins without deleting them.
wp plugin deactivate akismet
wp plugin deactivate --all
--all is the go-to for debugging plugin conflicts — deactivate everything, then reactivate one by one to isolate the problem.
wp plugin update
Updates plugins to the latest available version.
wp plugin update akismet
wp plugin update --all
wp plugin update --all --dry-run
wp plugin update akismet --version=5.3.0
--all updates every plugin at once. --dry-run shows what would be updated without making changes — useful before running updates on production. --version allows downgrading to a specific version.
wp plugin delete
Removes a plugin from the filesystem.
wp plugin delete akismet
wp plugin delete akismet contact-form-7
Plugin must be deactivated first. This permanently removes the plugin files — not just from the admin, from disk.
wp plugin get
Returns details about a specific plugin.
wp plugin get akismet
wp plugin get akismet --format=json
Shows name, status, version, description, and author. Useful in scripts that need to check plugin state before running other operations.
wp plugin is-installed
Checks whether a plugin is installed.
wp plugin is-installed akismet
Returns exit code 0 if installed, 1 if not. Use in shell scripts to conditionally install:
if ! wp plugin is-installed akismet; then
wp plugin install akismet --activate
fi
wp plugin search
Searches the WordPress.org plugin repository.
wp plugin search caching
wp plugin search seo --per-page=5 --format=table
Useful when you don’t know the exact slug. Returns plugin name, slug, rating, and number of active installs.
wp plugin verify-checksums
Verifies plugin files against official WordPress.org checksums.
wp plugin verify-checksums --all
wp plugin verify-checksums akismet
Detects modified or corrupted plugin files. Use during security audits or after a suspected compromise.
Common Workflows
Environment setup — install required plugins
wp plugin install acf --activate
wp plugin install wordpress-seo --activate
wp plugin install woocommerce --activate
wp plugin install redis-cache
Standard setup script for a new environment. Install everything needed, activate what should run immediately.
Maintenance update sequence
wp plugin list --update=available --format=json
wp db export backup-$(date +%Y%m%d).sql
wp plugin update --all
Check what needs updating, export the database first, then update. Safe pattern for production.
Debug plugin conflict
wp plugin deactivate --all
wp plugin activate plugin-a
wp plugin activate plugin-b
Deactivate everything, then reactivate plugins one by one until the conflict reappears. Much faster than toggling through the admin panel.
Audit plugin state across sites
wp plugin list --status=inactive --format=csv
Pipe to a file or script to audit unused plugins across environments. Inactive plugins are still a security risk if outdated.
Related Command Groups
- Core — manage WordPress itself before plugins
- Themes — same pattern, different group
- Database — always export before bulk updates
Practice Cases
- WordPress maintenance workflow (coming soon)
- CI/CD pipeline setup (coming soon)