0

I cna get list of widgets with

wp widget list sidebar-1

| search          | search-2          | 1 | {"title":""}
| recent-posts    | recent-posts-2    | 2 | {"title":"","number":5}
| recent-comments | recent-comments-2 | 3 | {"title":"","number":5}
| categories      | categories-2      | 4 | {"title":"","count":0}
| meta            | meta-3            | 5 | {"title":""}

I can deactivate meta plugins with:

wp widget deactivate meta-3

My problem is: how can I get the id meta-3 from widget list ? or any other method to deactivate some widgets like meta, recent-comments etc

  • 1
    Like using the parameters --fields and --format for example? – Nicolai Aug 14 '19 at 23:00
  • yes: worked with JSON format: thanks – yarek Aug 15 '19 at 10:15
  • My pleasure, I'm adding it as an answer, to conclude this thread. – Nicolai Aug 15 '19 at 10:36
1

Try using the --fields and --format parameter, e.g.

wp widget list sidebar-1 --fields=id --format=json

Docs: WP-CLI Commands wp widget list

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.