Title: wp widget
Published: February 5, 2018
Last modified: November 9, 2026

---

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

Manages widgets, including adding and moving them within sidebars.

## In this article

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

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

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

A [widget](https://developer.wordpress.org/themes/functionality/widgets/) adds content
and features to a widget area (also called a [sidebar](https://developer.wordpress.org/themes/functionality/sidebars/)).

### 󠀁[Examples](https://developer.wordpress.org/cli/commands/widget/?output_format=md#examples)󠁿

    ```
    # List widgets on a given sidebar
    $ wp widget list sidebar-1
    +----------+------------+----------+----------------------+
    | name     | id         | position | options              |
    +----------+------------+----------+----------------------+
    | meta     | meta-6     | 1        | {"title":"Meta"}     |
    | calendar | calendar-2 | 2        | {"title":"Calendar"} |
    +----------+------------+----------+----------------------+

    # Add a calendar widget to the second position on the sidebar
    $ wp widget add calendar sidebar-1 2
    Success: Added widget to sidebar.

    # Update option(s) associated with a given widget
    $ wp widget update calendar-1 --title="Calendar"
    Success: Widget updated.

    # Delete one or more widgets entirely
    $ wp widget delete calendar-2 archive-1
    Success: 2 widgets removed from sidebar.
    ```

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

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

Adds a widget to a sidebar.

  | 
| [wp widget deactivate](https://developer.wordpress.org/cli/commands/widget/deactivate/) |

Deactivates one or more widgets from an active sidebar.

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

Deletes one or more widgets from a sidebar.

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

Lists widgets associated with a sidebar.

  | 
| [wp widget move](https://developer.wordpress.org/cli/commands/widget/move/) |

Moves the position of a widget.

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

Updates a nested value in a widget’s options.

  | 
| [wp widget reset](https://developer.wordpress.org/cli/commands/widget/reset/) |

Resets sidebar.

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

Updates options for an existing widget.

  |

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