wp theme
Manages themes, including installs, activations, and updates.
See the WordPress Theme Handbook developer resource for more information on themes.
Subcommands
| Command | Description |
|---|---|
wp theme activate |
Activates a theme. |
wp theme auto-updates |
Manages theme auto-updates. |
wp theme delete |
Deletes one or more themes. |
wp theme disable |
Disables a theme on a WordPress multisite install. |
wp theme enable |
Enables a theme on a WordPress multisite install. |
wp theme get |
Gets details about a theme. |
wp theme install |
Installs one or more themes. |
wp theme is-active |
Checks if a given theme is active. |
wp theme is-installed |
Checks if a given theme is installed. |
wp theme list |
Gets a list of themes. |
wp theme mod |
Sets, gets, and removes theme mods. |
wp theme path |
Gets the path to a theme or to the theme directory. |
wp theme search |
Searches the WordPress.org theme directory. |
wp theme status |
Reveals the status of one or all themes. |
wp theme update |
Updates one or more themes. |
wp theme activate
Activates a theme.
Synopsis
wp theme activate <theme>
Examples
$ wp theme activate twentysixteen
Success: Switched to 'Twenty Sixteen' theme.
wp theme install
Installs one or more themes.
Synopsis
wp theme install <theme|zip|url>... [--version=<version>] [--force] [--ignore-requirements] [--activate] [--insecure]
Options
<theme|zip|url>...
: One or more themes to install. Accepts a theme slug, the path to a local zip file, or a URL to a remote zip file.
[--version=<version>]
: If set, get that particular version from wordpress.org, instead of the stable version.
[--force]
: If set, the command will overwrite any installed version of the theme.
[--ignore-requirements]
: If set, the command will install the theme while ignoring any version requirements.
[--activate]
: If set, the theme will be activated immediately after install.
[--insecure]
: Retry downloads without certificate validation if TLS handshake fails.
Examples
# Install the latest version from wordpress.org and activate
$ wp theme install twentysixteen --activate
Installing Twenty Sixteen (1.2)
Downloading install package from http://downloads.wordpress.org/theme/twentysixteen.1.2.zip...
Unpacking the package...
Installing the theme...
Theme installed successfully.
Activating 'twentysixteen'...
Success: Switched to 'Twenty Sixteen' theme.
Success: Installed 1 of 1 themes.
# Install from a local zip file
$ wp theme install ../my-theme.zip
# Install from a remote zip file
$ wp theme install http://s3.amazonaws.com/bucketname/my-theme.zip?AWSAccessKeyId=123&Expires=456&Signature=abcdef
wp theme list
Gets a list of themes.
Synopsis
wp theme list [--<field>=<value>] [--field=<field>] [--fields=<fields>] [--format=<format>] [--status=<status>] [--skip-update-check]
Options
[--<field>=<value>]
: Filter results based on the value of a field.
[--field=<field>]
: Prints the value of a single field for each theme.
[--fields=<fields>]
: Limit the output to specific object fields.
[--format=<format>]
: Render output in a particular format. Default: table. Options: table, csv, json, count, yaml.
[--status=<status>]
: Filter the output by theme status. Options: active, parent, inactive.
[--skip-update-check]
: If set, the theme update check will be skipped.
Available Fields
Default fields: name, status, update, version, update_version, auto_update.
Optional fields: update_package, update_id, title, description.
Examples
# List inactive themes.
$ wp theme list --status=inactive --format=csv
name,status,update,version,update_version,auto_update
twentyfourteen,inactive,none,3.8,,off
twentysixteen,inactive,available,3.0,3.1,off
wp theme update
Updates one or more themes.
Synopsis
wp theme update [<theme>...] [--all] [--exclude=<theme-names>] [--minor] [--patch] [--format=<format>] [--version=<version>] [--dry-run] [--insecure]
Examples
# Update multiple themes
$ wp theme update twentyfifteen twentysixteen
Downloading update from https://downloads.wordpress.org/theme/twentyfifteen.1.5.zip...
Unpacking the update...
Installing the latest version...
Removing the old version of the theme...
Theme updated successfully.
+---------------+-------------+-------------+---------+
| name | old_version | new_version | status |
+---------------+-------------+-------------+---------+
| twentyfifteen | 1.4 | 1.5 | Updated |
| twentysixteen | 1.1 | 1.2 | Updated |
+---------------+-------------+-------------+---------+
Success: Updated 2 of 2 themes.
# Update all themes
$ wp theme update --all
Examples
# Install the latest version of a theme from wordpress.org and activate
$ wp theme install twentysixteen --activate
Installing Twenty Sixteen (1.2)
Downloading install package from http://downloads.wordpress.org/theme/twentysixteen.1.2.zip...
Unpacking the package...
Installing the theme...
Theme installed successfully.
Activating 'twentysixteen'...
Success: Switched to 'Twenty Sixteen' theme.
Success: Installed 1 of 1 themes.
# Get details of an installed theme
$ wp theme get twentysixteen --fields=name,title,version
+---------+----------------+
| Field | Value |
+---------+----------------+
| name | Twenty Sixteen |
| title | Twenty Sixteen |
| version | 1.2 |
+---------+----------------+
# Get status of theme
$ wp theme status twentysixteen
Theme twentysixteen details:
Name: Twenty Sixteen
Status: Active
Version: 1.2
Author: the WordPress team