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.

One thought on “Deleting or Downgrading Inactive Users on Multisite Networks”

  1. The inactive-user option addresses a useful gap in the normal UI. I would want to review the matched users before applying it and check content reassignment on each site, since a network account and a site role are different things. Downgrading first also seems easier to reverse than deleting accounts when activity records are incomplete.

Leave a Reply

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