{"id":28619600,"url":"https://github.com/wp-cli/widget-command","last_synced_at":"2026-04-02T17:58:09.005Z","repository":{"id":45040881,"uuid":"88057362","full_name":"wp-cli/widget-command","owner":"wp-cli","description":"Adds, moves, and removes widgets; lists sidebars.","archived":false,"fork":false,"pushed_at":"2026-03-25T10:38:34.000Z","size":8694,"stargazers_count":6,"open_issues_count":0,"forks_count":11,"subscribers_count":4,"default_branch":"main","last_synced_at":"2026-03-26T13:39:57.722Z","etag":null,"topics":["cli","hacktoberfest","widget","widgets","wordpress","wp-cli","wp-cli-package"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wp-cli.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2017-04-12T13:52:09.000Z","updated_at":"2026-03-25T10:38:37.000Z","dependencies_parsed_at":"2024-04-19T14:42:05.438Z","dependency_job_id":"f1ade695-82b8-49df-bad7-9fb4064773bb","html_url":"https://github.com/wp-cli/widget-command","commit_stats":{"total_commits":463,"total_committers":45,"mean_commits":10.28888888888889,"dds":0.7386609071274298,"last_synced_commit":"366fc586f64faea41c1e6df345b2350193b89c6b"},"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"purl":"pkg:github/wp-cli/widget-command","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wp-cli%2Fwidget-command","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wp-cli%2Fwidget-command/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wp-cli%2Fwidget-command/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wp-cli%2Fwidget-command/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wp-cli","download_url":"https://codeload.github.com/wp-cli/widget-command/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wp-cli%2Fwidget-command/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31312744,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T12:59:32.332Z","status":"ssl_error","status_checked_at":"2026-04-02T12:54:48.875Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","hacktoberfest","widget","widgets","wordpress","wp-cli","wp-cli-package"],"created_at":"2025-06-12T04:40:35.296Z","updated_at":"2026-04-02T17:58:08.996Z","avatar_url":"https://github.com/wp-cli.png","language":"PHP","readme":"wp-cli/widget-command\n=====================\n\nAdds, moves, and removes widgets; lists sidebars.\n\n[![Testing](https://github.com/wp-cli/widget-command/actions/workflows/testing.yml/badge.svg)](https://github.com/wp-cli/widget-command/actions/workflows/testing.yml) [![Code Coverage](https://codecov.io/gh/wp-cli/widget-command/branch/main/graph/badge.svg)](https://codecov.io/gh/wp-cli/widget-command/tree/main)\n\nQuick links: [Using](#using) | [Installing](#installing) | [Contributing](#contributing) | [Support](#support)\n\n## Using\n\nThis package implements the following commands:\n\n### wp widget\n\nManages widgets, including adding and moving them within sidebars.\n\n~~~\nwp widget\n~~~\n\nA [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/)).\n\n**EXAMPLES**\n\n    # List widgets on a given sidebar\n    $ wp widget list sidebar-1\n    +----------+------------+----------+----------------------+\n    | name     | id         | position | options              |\n    +----------+------------+----------+----------------------+\n    | meta     | meta-6     | 1        | {\"title\":\"Meta\"}     |\n    | calendar | calendar-2 | 2        | {\"title\":\"Calendar\"} |\n    +----------+------------+----------+----------------------+\n\n    # Add a calendar widget to the second position on the sidebar\n    $ wp widget add calendar sidebar-1 2\n    Success: Added widget to sidebar.\n\n    # Update option(s) associated with a given widget\n    $ wp widget update calendar-1 --title=\"Calendar\"\n    Success: Widget updated.\n\n    # Delete one or more widgets entirely\n    $ wp widget delete calendar-2 archive-1\n    Success: 2 widgets removed from sidebar.\n\n\n\n### wp widget add\n\nAdds a widget to a sidebar.\n\n~~~\nwp widget add \u003cname\u003e \u003csidebar-id\u003e [\u003cposition\u003e] [--\u003cfield\u003e=\u003cvalue\u003e]\n~~~\n\nCreates a new widget entry in the database, and associates it with the\nsidebar.\n\n**OPTIONS**\n\n\t\u003cname\u003e\n\t\tWidget name.\n\n\t\u003csidebar-id\u003e\n\t\tID for the corresponding sidebar.\n\n\t[\u003cposition\u003e]\n\t\tWidget's current position within the sidebar. Defaults to last\n\n\t[--\u003cfield\u003e=\u003cvalue\u003e]\n\t\tWidget option to add, with its new value\n\n**EXAMPLES**\n\n    # Add a new calendar widget to sidebar-1 with title \"Calendar\"\n    $ wp widget add calendar sidebar-1 2 --title=\"Calendar\"\n    Success: Added widget to sidebar.\n\n\n\n### wp widget deactivate\n\nDeactivates one or more widgets from an active sidebar.\n\n~~~\nwp widget deactivate \u003cwidget-id\u003e...\n~~~\n\nMoves widgets to Inactive Widgets.\n\n**OPTIONS**\n\n\t\u003cwidget-id\u003e...\n\t\tUnique ID for the widget(s)\n\n**EXAMPLES**\n\n    # Deactivate the recent-comments-2 widget.\n    $ wp widget deactivate recent-comments-2\n    Success: 1 widget deactivated.\n\n\n\n### wp widget delete\n\nDeletes one or more widgets from a sidebar.\n\n~~~\nwp widget delete \u003cwidget-id\u003e...\n~~~\n\n**OPTIONS**\n\n\t\u003cwidget-id\u003e...\n\t\tUnique ID for the widget(s)\n\n**EXAMPLES**\n\n    # Delete the recent-comments-2 widget from its sidebar.\n    $ wp widget delete recent-comments-2\n    Success: Deleted 1 of 1 widgets.\n\n\n\n### wp widget list\n\nLists widgets associated with a sidebar.\n\n~~~\nwp widget list \u003csidebar-id\u003e [--fields=\u003cfields\u003e] [--format=\u003cformat\u003e]\n~~~\n\n**OPTIONS**\n\n\t\u003csidebar-id\u003e\n\t\tID for the corresponding sidebar.\n\n\t[--fields=\u003cfields\u003e]\n\t\tLimit the output to specific object fields.\n\n\t[--format=\u003cformat\u003e]\n\t\tRender output in a particular format.\n\t\t---\n\t\tdefault: table\n\t\toptions:\n\t\t  - table\n\t\t  - csv\n\t\t  - ids\n\t\t  - json\n\t\t  - count\n\t\t  - yaml\n\t\t---\n\n**AVAILABLE FIELDS**\n\nThese fields will be displayed by default for each widget:\n\n* name\n* id\n* position\n* options\n\nThere are no optionally available fields.\n\n**EXAMPLES**\n\n    $ wp widget list sidebar-1 --fields=name,id --format=csv\n    name,id\n    meta,meta-5\n    search,search-3\n\n\n\n### wp widget move\n\nMoves the position of a widget.\n\n~~~\nwp widget move \u003cwidget-id\u003e [--position=\u003cposition\u003e] [--sidebar-id=\u003csidebar-id\u003e]\n~~~\n\nChanges the order of a widget in its existing sidebar, or moves it to a\nnew sidebar.\n\n**OPTIONS**\n\n\t\u003cwidget-id\u003e\n\t\tUnique ID for the widget\n\n\t[--position=\u003cposition\u003e]\n\t\tAssign the widget to a new position.\n\n\t[--sidebar-id=\u003csidebar-id\u003e]\n\t\tAssign the widget to a new sidebar\n\n**EXAMPLES**\n\n    # Change position of widget\n    $ wp widget move recent-comments-2 --position=2\n    Success: Widget moved.\n\n    # Move widget to Inactive Widgets\n    $ wp widget move recent-comments-2 --sidebar-id=wp_inactive_widgets\n    Success: Widget moved.\n\n\n\n### wp widget patch\n\nUpdates a nested value in a widget's options.\n\n~~~\nwp widget patch \u003caction\u003e \u003cwidget-id\u003e \u003ckey-path\u003e... [\u003cvalue\u003e] [--format=\u003cformat\u003e]\n~~~\n\n**OPTIONS**\n\n\t\u003caction\u003e\n\t\tPatch action to perform.\n\t\t---\n\t\toptions:\n\t\t  - insert\n\t\t  - update\n\t\t  - delete\n\t\t---\n\n\t\u003cwidget-id\u003e\n\t\tUnique ID for the widget.\n\n\t\u003ckey-path\u003e...\n\t\tThe name(s) of the keys within the value to locate the value to patch.\n\n\t[\u003cvalue\u003e]\n\t\tThe new value. If omitted, the value is read from STDIN.\n\n\t[--format=\u003cformat\u003e]\n\t\tThe serialization format for the value.\n\t\t---\n\t\tdefault: plaintext\n\t\toptions:\n\t\t  - plaintext\n\t\t  - json\n\t\t---\n\n**EXAMPLES**\n\n    # Update a nested value in the options of the archives-1 widget\n    $ wp widget patch update archives-1 title \"My Archives\"\n    Success: Widget updated.\n\n    # Insert a new nested value into the options of the archives-1 widget\n    $ wp widget patch insert archives-1 new_key \"New Value\"\n    Success: Widget updated.\n\n    # Delete a nested value from the options of the archives-1 widget\n    $ wp widget patch delete archives-1 title\n    Success: Widget updated.\n\n\n\n### wp widget reset\n\nResets sidebar.\n\n~~~\nwp widget reset [\u003csidebar-id\u003e...] [--all] [--inactive]\n~~~\n\nRemoves all widgets from the sidebar and places them in Inactive Widgets.\n\n**OPTIONS**\n\n\t[\u003csidebar-id\u003e...]\n\t\tOne or more sidebars to reset.\n\n\t[--all]\n\t\tIf set, all sidebars will be reset.\n\n\t[--inactive]\n\t\tIf set, all inactive sidebars will also be reset, in addition to any sidebars specified via \u003csidebar-id\u003e... or selected with --all.\n\n**EXAMPLES**\n\n    # Reset a sidebar\n    $ wp widget reset sidebar-1\n    Sidebar 'sidebar-1' reset.\n\n    # Reset multiple sidebars\n    $ wp widget reset sidebar-1 sidebar-2\n    Sidebar 'sidebar-1' reset.\n    Sidebar 'sidebar-2' reset.\n\n    # Reset all sidebars\n    $ wp widget reset --all\n    Sidebar 'sidebar-1' reset.\n    Sidebar 'sidebar-2' reset.\n    Sidebar 'sidebar-3' reset.\n\n    # Reset all inactive sidebars\n    $ wp widget reset --inactive\n    Sidebar 'old-sidebar-1' reset.\n\n\n\n### wp widget update\n\nUpdates options for an existing widget.\n\n~~~\nwp widget update \u003cwidget-id\u003e [--\u003cfield\u003e=\u003cvalue\u003e]\n~~~\n\n**OPTIONS**\n\n\t\u003cwidget-id\u003e\n\t\tUnique ID for the widget\n\n\t[--\u003cfield\u003e=\u003cvalue\u003e]\n\t\tField to update, with its new value\n\n**EXAMPLES**\n\n    # Change calendar-1 widget title to \"Our Calendar\"\n    $ wp widget update calendar-1 --title=\"Our Calendar\"\n    Success: Widget updated.\n\n\n\n### wp sidebar\n\nLists registered sidebars.\n\n~~~\nwp sidebar\n~~~\n\nA [sidebar](https://developer.wordpress.org/themes/functionality/sidebars/) is any widgetized area of your theme.\n\n**EXAMPLES**\n\n    # List sidebars\n    $ wp sidebar list --fields=name,id --format=csv\n    name,id\n    \"Widget Area\",sidebar-1\n    \"Inactive Widgets\",wp_inactive_widgets\n\n\n\n### wp sidebar exists\n\nCheck if a sidebar exists.\n\n~~~\nwp sidebar exists \u003cid\u003e\n~~~\n\n**OPTIONS**\n\n\t\u003cid\u003e\n\t\tThe sidebar ID.\n\n**EXAMPLES**\n\n    $ wp sidebar exists sidebar-1\n    $ wp sidebar exists wp_inactive_widgets \u0026\u0026 echo \"exists\"\n\n\n\n### wp sidebar get\n\nGet details about a specific sidebar.\n\n~~~\nwp sidebar get \u003cid\u003e [--fields=\u003cfields\u003e] [--format=\u003cformat\u003e]\n~~~\n\n**OPTIONS**\n\n\t\u003cid\u003e\n\t\tThe sidebar ID.\n\n\t[--fields=\u003cfields\u003e]\n\t\tLimit the output to specific object fields.\n\n\t[--format=\u003cformat\u003e]\n\t\tRender output in a particular format.\n\t\t---\n\t\tdefault: table\n\t\toptions:\n\t\t  - table\n\t\t  - csv\n\t\t  - json\n\t\t  - ids\n\t\t  - count\n\t\t  - yaml\n\t\t---\n\n**EXAMPLES**\n\n    $ wp sidebar get sidebar-1\n    $ wp sidebar get wp_inactive_widgets --format=json\n\n\n\n### wp sidebar list\n\nLists registered sidebars.\n\n~~~\nwp sidebar list [--inactive] [--fields=\u003cfields\u003e] [--format=\u003cformat\u003e]\n~~~\n\n**OPTIONS**\n\n\t[--inactive]\n\t\tIf set, only inactive sidebars will be listed.\n\n\t[--fields=\u003cfields\u003e]\n\t\tLimit the output to specific object fields.\n\n\t[--format=\u003cformat\u003e]\n\t\tRender output in a particular format.\n\t\t---\n\t\tdefault: table\n\t\toptions:\n\t\t  - table\n\t\t  - csv\n\t\t  - json\n\t\t  - ids\n\t\t  - count\n\t\t  - yaml\n\t\t---\n\n**AVAILABLE FIELDS**\n\nThese fields will be displayed by default for each sidebar:\n\n* name\n* id\n* description\n\nThese fields are optionally available:\n\n* class\n* before_widget\n* after_widget\n* before_title\n* after_title\n\n**EXAMPLES**\n\n    $ wp sidebar list --fields=name,id --format=csv\n    name,id\n    \"Widget Area\",sidebar-1\n    \"Inactive Widgets\",wp_inactive_widgets\n\n    $ wp sidebar list --inactive --fields=id --format=csv\n    id\n    old-sidebar-1\n\n## Installing\n\nThis package is included with WP-CLI itself, no additional installation necessary.\n\nTo install the latest version of this package over what's included in WP-CLI, run:\n\n    wp package install git@github.com:wp-cli/widget-command.git\n\n## Contributing\n\nWe appreciate you taking the initiative to contribute to this project.\n\nContributing isn’t limited to just code. We encourage you to contribute in the way that best fits your abilities, by writing tutorials, giving a demo at your local meetup, helping other users with their support questions, or revising our documentation.\n\nFor a more thorough introduction, [check out WP-CLI's guide to contributing](https://make.wordpress.org/cli/handbook/contributing/). This package follows those policy and guidelines.\n\n### Reporting a bug\n\nThink you’ve found a bug? We’d love for you to help us get it fixed.\n\nBefore you create a new issue, you should [search existing issues](https://github.com/wp-cli/widget-command/issues?q=label%3Abug%20) to see if there’s an existing resolution to it, or if it’s already been fixed in a newer version.\n\nOnce you’ve done a bit of searching and discovered there isn’t an open or fixed issue for your bug, please [create a new issue](https://github.com/wp-cli/widget-command/issues/new). Include as much detail as you can, and clear steps to reproduce if possible. For more guidance, [review our bug report documentation](https://make.wordpress.org/cli/handbook/bug-reports/).\n\n### Creating a pull request\n\nWant to contribute a new feature? Please first [open a new issue](https://github.com/wp-cli/widget-command/issues/new) to discuss whether the feature is a good fit for the project.\n\nOnce you've decided to commit the time to seeing your pull request through, [please follow our guidelines for creating a pull request](https://make.wordpress.org/cli/handbook/pull-requests/) to make sure it's a pleasant experience. See \"[Setting up](https://make.wordpress.org/cli/handbook/pull-requests/#setting-up)\" for details specific to working on this package locally.\n\n### License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n\n## Support\n\nGitHub issues aren't for general support questions, but there are other venues you can try: https://wp-cli.org/#support\n\n\n*This README.md is generated dynamically from the project's codebase using `wp scaffold package-readme` ([doc](https://github.com/wp-cli/scaffold-package-command#wp-scaffold-package-readme)). To suggest changes, please submit a pull request against the corresponding part of the codebase.*\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwp-cli%2Fwidget-command","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwp-cli%2Fwidget-command","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwp-cli%2Fwidget-command/lists"}