WP-CLI Theme Commands
Theme commands manage WordPress themes from the terminal — installing, activating, updating, and auditing what’s on the site. Same pattern as plugin commands, different scope.
Commands
wp theme list
Lists all installed themes with status, version, and available updates.
wp theme list
wp theme list --status=active
wp theme list --status=inactive
wp theme list --format=json
WordPress always has one active theme. Everything else is inactive. Use this to audit what’s installed before cleanup or deployment.
wp theme install
Installs a theme from the WordPress.org repository, a ZIP file, or a remote URL.
wp theme install storefront
wp theme install storefront --activate
wp theme install /path/to/theme.zip
wp theme install https://example.com/theme.zip
wp theme install storefront --version=4.4.0
--activate installs and switches to the theme immediately. Use a ZIP path or URL for premium or custom themes. --version pins a specific release.
wp theme activate
Switches the active theme.
wp theme activate twentytwentyfour
wp theme activate storefront
One active theme at a time. Switching themes does not delete the previous one — it becomes inactive. Note: switching theme may affect menus, widgets, and customizer settings.
wp theme update
Updates themes to the latest available version.
wp theme update storefront
wp theme update --all
wp theme update --all --dry-run
--all updates every installed theme. --dry-run shows what would be updated without making changes. Always check for child theme dependencies before updating a parent theme.
wp theme delete
Removes a theme from the filesystem.
wp theme delete storefront
wp theme delete twentytwentytwo twentytwentyone
Cannot delete the currently active theme. Removes files from disk permanently. Good practice to delete unused themes — they are a security risk if outdated.
wp theme get
Returns details about a specific theme.
wp theme get storefront
wp theme get storefront --format=json
Shows name, status, version, description, and author. Useful in scripts that check theme state before running operations.
wp theme is-installed
Checks whether a theme is installed.
wp theme is-installed storefront
Returns exit code 0 if installed, 1 if not. Use in shell scripts to conditionally install:
if ! wp theme is-installed storefront; then
wp theme install storefront --activate
fi
wp theme mod get / set / remove
Manages theme customizer settings (theme mods) from the terminal.
wp theme mod get
wp theme mod get header_textcolor
wp theme mod set header_textcolor 333333
wp theme mod remove header_textcolor
Useful when setting up or resetting theme configuration in automated workflows. Works with any theme option registered through the WordPress Customizer API.
wp theme search
Searches the WordPress.org theme repository.
wp theme search portfolio
wp theme search ecommerce --per-page=5 --format=table
Returns theme name, slug, rating, and number of active installs. Useful when you don’t know the exact slug.
Common Workflows
Install and activate a theme in one step
wp theme install storefront --activate
Most common use — deploy and activate immediately. Useful in setup scripts.
Deploy a child theme from ZIP
wp theme install /deploy/themes/mytheme-parent.zip --activate
wp theme install /deploy/themes/mytheme-child.zip --activate
Install parent first, then child. Activate the child theme — not the parent. This is the correct order for child theme deployments.
Cleanup unused themes
wp theme list --status=inactive --format=csv
wp theme delete twentytwentyone twentytwentytwo
List inactive themes first, then remove what’s not needed. Keep at least one fallback theme installed — WordPress requires it.
Maintenance update sequence
wp theme list --update=available
wp db export backup-$(date +%Y%m%d).sql
wp theme update --all
Check what needs updating, export database, then update. Same safe pattern as plugin updates.
Related Command Groups
- Core — WordPress itself, before themes
- Plugins — same pattern, different scope
- Database — export before switching or updating themes
Practice Cases
- Deploy a new WordPress site (coming soon)
- WordPress maintenance workflow (coming soon)