Title: wp option
Published: February 5, 2018
Last modified: April 13, 2026

---

# 󠀁[wp option <command>](https://developer.wordpress.org/cli/commands/option/)󠁿

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

## In this article

 * [Examples](https://developer.wordpress.org/cli/commands/option/?output_format=md#examples)
 * [Subcommands](https://developer.wordpress.org/cli/commands/option/?output_format=md#subcommands)

[ Back to top](https://developer.wordpress.org/cli/commands/option/?output_format=md#wp--skip-link--target)

 [ ⌊GitHub⌉ ](https://github.com/wp-cli/entity-command)

 [ View Open Issues (1) ](https://github.com/login?return_to=%2Fissues%3Fq%3Dlabel%3Acommand%3Aoption+sort%3Aupdated-desc+org%3Awp-cli+is%3Aopen)
[ View Closed Issues (45) ](https://github.com/login?return_to=%2Fissues%3Fq%3Dlabel%3Acommand%3Aoption+sort%3Aupdated-desc+org%3Awp-cli+is%3Aclosed)
[Create New Issue](https://github.com/wp-cli/entity-command/issues/new)

See the [Plugin Settings API](https://developer.wordpress.org/plugins/settings/settings-api/)
and the [Theme Options](https://developer.wordpress.org/themes/customize-api/) for
more information on adding customized options.

### 󠀁[Examples](https://developer.wordpress.org/cli/commands/option/?output_format=md#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.
    ```

### 󠀁[Subcommands](https://developer.wordpress.org/cli/commands/option/?output_format=md#subcommands)󠁿

| Name | Description | 
| [wp option add](https://developer.wordpress.org/cli/commands/option/add/) |

Adds a new option value.

  | 
| [wp option delete](https://developer.wordpress.org/cli/commands/option/delete/) |

Deletes an option.

  | 
| [wp option get](https://developer.wordpress.org/cli/commands/option/get/) |

Gets the value for an option.

  | 
| [wp option get-autoload](https://developer.wordpress.org/cli/commands/option/get-autoload/) |

Gets the ‘autoload’ value for an option.

  | 
| [wp option list](https://developer.wordpress.org/cli/commands/option/list/) |

Lists options and their values.

  | 
| [wp option patch](https://developer.wordpress.org/cli/commands/option/patch/) |

Updates a nested value in an option.

  | 
| [wp option pluck](https://developer.wordpress.org/cli/commands/option/pluck/) |

Gets a nested value from an option.

  | 
| [wp option set](https://developer.wordpress.org/cli/commands/option/set/) |

Updates an option value.

  | 
| [wp option set-autoload](https://developer.wordpress.org/cli/commands/option/set-autoload/) |

Sets the ‘autoload’ value for an option.

  | 
| [wp option update](https://developer.wordpress.org/cli/commands/option/update/) |

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