wp option <command>

Manage options.


# Get site URL.
$ wp option get siteurl

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


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 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.