wp option <command>

Retrieves and sets site options, including plugin and WordPress settings.

See the Plugin Settings API and the Theme Options for more information on adding customized options.

EXAMPLES EXAMPLES

# Get site URL.
$ wp option get siteurl
http://example.com

# Add option.
$ wp option add my_option foobar
Success: Added 'my_option' option.

# Update option.
$ wp option update my_option '{"foo": "bar"}' --format=json
Success: Updated 'my_option' option.

# Delete option.
$ wp option delete my_option
Success: Deleted 'my_option' option.

Top ↑

SUBCOMMANDS SUBCOMMANDS

Name Description
wp option add

Add a new option value.

wp option delete

Delete an option.

wp option get

Get the value for an option.

wp option list

List options and their values.

wp option patch

Update a nested value in an option.

wp option pluck

Get a nested value from an option.

wp option update

Update an option value.

Command documentation is regenerated at every release. To add or update an example, please submit a pull request against the corresponding part of the codebase.