All posts tagged wp-cli

Finding all Sites That have a Plugin Active

by Ian Dunn

I wanted to find out which sites in a Multisite network had a certain plugin active, but couldn’t find an existing solution I was happy with. So, I wrote a WP-CLI command to do the job. Installation wp package install iandunn/wp-cli-plugin-active-on-sites Usage wp plugin active-on-sites Example > wp plugin active-on-sites eu-cookie-law-widget Checking each site 100% [======================================] 0:02 / 0:03… [more]

Rename WordPress’ Database Prefix with WP-CLI

by Ian Dunn

I wanted to update the database prefix one this site, but most of the tutorials out there have you do it manually. There are some plugins available, but I didn’t trust most of them, and the ones that I did were kind of bloated with other features, and I didn’t want to mess with the… [more]

Flushing Rewrite Rules on All Sites in a Multisite Network

by Ian Dunn

TL;DR:  View the code on Meta Trac . Every once in awhile I’ll run into a situation where something will break permalinks on all the sites in a WordPress Multisite network, like a plugin network-activation gone wrong. On a single site, it’s easy enough to fix by manually visiting Settings > Permalinks, which will flush and rebuild the rewrite rules, but if you’ve got… [more]