I'm looking for a way to count active instances of a given widget across a WordPress Network. For instance, I have Widget A. I need to count how many times Widget A exists in any sidebar on any site within the network. Obviously WP-CLI is probably the way to go, but I'm struggling with identifying active widgets.
Asked
Active
Viewed 94 times
1 Answers
0
The answer is WP-CLI. Iterate through all sidebars then iterate through all widgets in those sidebars.
Sample code:
https://gist.github.com/mrpritchett/e9a48b959e5d78d2d8174d97361c1c4b

mrpritchett
- 75
- 1
- 1
- 11