I am trying to loop through all sites on a multisite network, and for each site, delete all subscriber users. I have tried this WP-CLI command:
wp site list --field=url | xargs -n 1 -I ^ wp user list --url=^ --role=subscriber --field=ID | xargs -n 2 -I % ^ wp user delete % --url=^ --reassign=4
I can't find a way to pass the
^ value to the second xargs command. Anyone?