wp theme

Manages themes, including installs, activations, and updates.

See the WordPress Theme Handbook developer resource for more information on themes.

Subcommands

CommandDescription
wp theme activateActivates a theme.
wp theme auto-updatesManages theme auto-updates.
wp theme deleteDeletes one or more themes.
wp theme disableDisables a theme on a WordPress multisite install.
wp theme enableEnables a theme on a WordPress multisite install.
wp theme getGets details about a theme.
wp theme installInstalls one or more themes.
wp theme is-activeChecks if a given theme is active.
wp theme is-installedChecks if a given theme is installed.
wp theme listGets a list of themes.
wp theme modSets, gets, and removes theme mods.
wp theme pathGets the path to a theme or to the theme directory.
wp theme searchSearches the WordPress.org theme directory.
wp theme statusReveals the status of one or all themes.
wp theme updateUpdates one or more themes.

wp theme activate

Activates a theme.

Synopsis

bash
wp theme activate <theme>

Examples

bash
$ wp theme activate twentysixteen
Success: Switched to 'Twenty Sixteen' theme.

wp theme install

Installs one or more themes.

Synopsis

bash
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

bash
# 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

bash
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

bash
# 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

bash
wp theme update [<theme>...] [--all] [--exclude=<theme-names>] [--minor] [--patch] [--format=<format>] [--version=<version>] [--dry-run] [--insecure]

Examples

bash
# 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

bash
# 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