Widgets live in a screen I rarely open, so when I want to know what a sidebar holds I’d rather ask WP-CLI.
wp widget list <sidebar-id>
The sidebar ID is required. A theme’s main sidebar is often called sidebar-1, but check what your theme registers. The default table has four columns: name, id, position and options. The options column holds each widget’s settings, so the table gets wide quickly. Trim it with --fields:
wp widget list sidebar-1 --fields=name,id --format=csv
The docs show this output for it:
name,id
meta,meta-5
search,search-3
Those are the docs’ example widgets, yours will differ. --format takes table, csv, ids, json, count and yaml. count is a quick way to see how many widgets a sidebar holds, and json suits scripts.
A caveat: there are no optional fields, so the four above are all you get. If the ID is wrong you won’t get a useful list, which is why the next step is wp sidebar list: it shows the IDs the theme registers.
The sidebar command works the same way. The docs example wp sidebar list --fields=name,id --format=csv prints the name and ID of every registered sidebar. Its default fields are name, id and description, and class, before_widget, after_widget, before_title and after_title are available when you ask for them. The docs also show an --inactive flag, but mark it as not part of a stable WP-CLI release yet.
Once you know the widget ID, other wp widget subcommands act on it: update changes its options, move changes its position, and delete removes it.
Further reading: wp widget list