handbook/commands/option.md
2017-10-17 06:46:41 -07:00

718 B

wp option

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

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