wp plugin install
Overview
Install plugins from WordPress.org, a zip archive, or a direct URL without touching the dashboard. Combine with --activate to install and enable in a single command.
What It Does
wp plugin install downloads and installs a plugin from WordPress.org (by slug), a local zip file, or a remote zip URL. It creates the plugin directory under wp-content/plugins/ and extracts the files. Optionally, it activates the plugin immediately.
Syntax
wp plugin install <plugin|zip|url>... [--version=<version>] [--force] [--activate] [--activate-network] [--insecure]
Arguments & Options
| Argument / Flag | Description |
|---|---|
PLUGIN | WordPress.org plugin slug |
ZIP | Path to a local .zip file |
URL | URL of a .zip plugin package |
--version=VERSION | Install a specific version |
--force | Overwrite existing installation |
--activate | Activate after install |
--activate-network | Network-activate on multisite after install |
--insecure | Skip SSL verification |
Basic Usage
Install from WordPress.org
wp plugin install woocommerce
Install and activate immediately
wp plugin install woocommerce --activate
Install a specific version
wp plugin install woocommerce --version=8.9.0
Install from a local zip file
wp plugin install /path/to/my-custom-plugin.zip --activate
Install from a URL (premium plugin)
wp plugin install https://example.com/downloads/my-plugin.zip --activate
Force reinstall (overwrite existing)
wp plugin install woocommerce --force
Install multiple plugins at once
wp plugin install woocommerce contact-form-7 yoast-seo litespeed-cache --activate
Expected Output
Installing WooCommerce (9.0.1)
Downloading install package from https://downloads.wordpress.org/plugin/woocommerce.9.0.1.zip...
Unpacking the package...
Installing the plugin...
Plugin installed successfully.
Activating 'woocommerce'...
Plugin 'woocommerce' activated.
Success: Installed 1 of 1 plugins.
Real-World Scenarios
Scenario 1: Fresh WordPress setup with standard plugin stack
#!/bin/bash
PLUGINS=(
"woocommerce"
"contact-form-7"
"yoast-seo"
"litespeed-cache"
"acf"
"wordfence"
)
for plugin in "${PLUGINS[@]}"; do
wp plugin install "${plugin}" --activate
done
echo "All plugins installed and activated ✅"
Scenario 2: Install a specific version for compatibility testing
# Install an older WooCommerce for testing
wp plugin install woocommerce --version=8.5.0 --force --activate
Scenario 3: Install a premium plugin from URL (with auth token)
# Many premium plugins distribute via secure download URLs
wp plugin install "https://api.mypremiumshop.com/downloads/plugin.zip?token=XXX" --activate
Scenario 4: Install from a zip in a deployment pipeline
# Company private plugin delivered as zip artifact
wp plugin install ./build/my-company-plugin.zip --activate --force
Scenario 5: Network-install and activate on multisite
wp plugin install woocommerce --activate-network
Best Practices
- Use
--activateby default — install + activate in one step is cleaner. - Specify
--versionwhen pinning — ensures reproducible environments. - Use
--forceonly when reinstalling after crashes or security incidents. - Install multiple plugins in a single command — more efficient than running separately.
- Verify after install with
wp plugin status SLUG.
Troubleshooting
| Problem | Cause | Fix |
|---|---|---|
Error: Plugin not found | Wrong slug or not on WordPress.org | Verify slug on wordpress.org/plugins |
| SSL verification failed | Server CA issue | Use --insecure (on trusted networks only) |
| Plugin installs but fails to activate | PHP/dependency error | Check PHP error log; resolve dependency |
Destination folder already exists | Plugin already installed | Add --force to overwrite |
| Zip not installing | Malformed zip or wrong structure | Unzip and inspect; ensure main plugin PHP file is valid |
Quick Reference
wp plugin install woocommerce # Install from WP.org
wp plugin install woocommerce --activate # Install + activate
wp plugin install woocommerce --version=8.9.0 # Specific version
wp plugin install my-plugin.zip --activate # From local zip
wp plugin install https://example.com/p.zip --activate # From URL
wp plugin install plugin-a plugin-b plugin-c --activate # Multiple
wp plugin install woocommerce --force # Reinstall
Next Steps
wp plugin activate— activate without reinstalling.wp plugin update— keep plugins current after install.wp plugin list— verify installed plugins.wp plugin uninstall— remove a plugin and its data.