Deleting or Downgrading Inactive Users on Multisite Networks

TL;DR:

  • composer require iandunn/wp-cli-network-users
  • wp user delete-network --users=2839,jubal.early,atherton.wing@example.org --reassign=hoban.washburne --scope=network
  • wp user set-role-network --inactive=365 --role=subscriber

Deleting users and setting roles on Multisite networks is tedious through the UI. WP-CLI can make that better, but is slow and still doesn’t make it easy or give you a lot of features.

That’s especially true on larger networks, and when you want to re-assign content. It also doesn’t cover the common use case where you want to target users who haven’t been active in a long time.

So, I wrote a set of commands with a bunch of options that make it easier.

Leave a Reply

Your email address will not be published. Required fields are marked *