WordPress at a glance
Home Handbook WP-CLI Commands

wp sidebar

Lists registered sidebars.

Commands Description
Lists registered sidebars.

Source code of the commands


wp sidebar list

Lists registered sidebars.

Usage

wp sidebar list [--fields={fields}] [--format={format}]

You can specify global options and the following:

[--fields={fields}]
Limit the output to specific object fields.
[--format={format}]

Render output in a particular format.
Default: table
Can be:

  • table
  • csv
  • json
  • ids
  • count
  • yaml

Available fields

These fields will be displayed by default for each sidebar:

  • name
  • id
  • description

These fields are optionally available:

  • class
  • before_widget
  • after_widget
  • before_title
  • after_title

Examples

$ wp sidebar list --fields=name,id --format=csv
name,id
"Widget Area",sidebar-1
"Inactive Widgets",wp_inactive_widgets