List inactive themes in a whole network #2523

Closed
enekogb opened this Issue Mar 3, 2016 · 1 comment

Projects

None yet

2 participants

@enekogb
enekogb commented Mar 3, 2016

Using the theme list command without url parameter shows if a theme is enabled for the network and active in the default site.

If you pass the url of a site of the network, this command shows if a theme is active in that site.

But i can't find a way to list which themes are inactive in every site of the network so i can safely disable and delete them, and i'd love to have this feature

@danielbachhuber
Member

I wrote a standalone command for you to use. If you upgrade to WP-CLI's nightly release wp cli update --nightly, you can install the package and run it locally:

salty-wordpress ➜  .wp-cli  wp package install danielbachhuber/wp-find-unused-themes-command
Installing danielbachhuber/wp-find-unused-themes-command (dev-master)
Updating /home/vagrant/.wp-cli/packages/composer.json to require the package...
Using Composer to install the package...
 - Installing package
Success: Package installed successfully.
salty-wordpress ➜  .wp-cli  j wordpress-test
/srv/www/wordpress-test.dev
salty-wordpress ➜  wordpress-test.dev  wp find-unused-themes
Checking http://wordpress-test.dev/ for unused themes...
Checking http://wordpress-test.dev/foo/ for unused themes...
Checking http://wordpress-test.dev/bar/ for unused themes...
Checking http://wordpress-test.dev/testsite/ for unused themes...
+----------------+---------+
| name           | version |
+----------------+---------+
| apples         | 1.0.0   |
| customizr      | 3.4.6   |
| twentyeleven   | 2.2     |
| twentyfourteen | 1.6     |
| twentysixteen  | 1.0     |
| twentythirteen | 1.5     |
| twentytwelve   | 1.8     |
+----------------+---------+

Feel free to open an issue in the project repo if you have any specific questions about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment