User Pruner
Identify and delete inactive user accounts (no WooCommerce orders, no comments, no posts). Review results, export CSV, and safely delete selected users.
by Michael Patrick · github.com/michaelspatrick/dsi-user-prune
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/michaelspatrick/dsi-user-prune/archive/refs/heads/main.zipDSI User Pruner
Identify and safely delete inactive WordPress user accounts who have never:
- Placed a WooCommerce order (status configurable)
- Commented on a post
- (Optionally) Authored posts (including CPTs, optional)
You can preview the list, export CSV, and delete selected users with optional reassignment of content.
Features
- Scan by minimum account age (days)
- Include/exclude specific roles (admins & shop managers excluded by default)
- Optional: also require 0 authored posts (and optional CPTs)
- Choose to treat only paid-ish WooCommerce order statuses as "has ordered"
- Whitelist by user ID, username, or email
- Review results in an admin table with checkboxes
- Export the current scan to CSV
- Delete selected users and auto-download a deletion log CSV
- Pagination controls via Limit + Offset
- WP-CLI command for automation
Installation
- Download the ZIP and upload via Plugins → Add New → Upload Plugin, or extract to
wp-content/plugins/dsi-user-prune/. - Activate DSI User Pruner.
- Go to Tools → DSI User Pruner.
Usage
- Choose your Minimum account age (days) and other criteria.
- Click Scan Users to preview candidates.
- (Optional) Click Export CSV to save the list.
- Select users to remove and click Delete Selected Users. You can reassign content to a specific user ID.
Always back up your database before deletion.
WooCommerce Notes
- If WooCommerce is inactive, the plugin treats orders as zero for all users.
- “Paid-ish” statuses by default:
processing,completed,on-hold,pending. You can instead count all statuses by unchecking the option. - Administrators and Shop Managers are excluded by default.
WP‑CLI
wp dsi-user-prune --help
wp dsi-user-prune scan --min-age=30 --include-posts --include-cpts --paid-only --export=/path/to/users.csv
If --export is omitted, results print to stdout. This command does not delete—deletions are only via the admin UI to reduce accidents.
Safety
- Uses nonces and capability checks (
delete_users). - Whitelist protects specific accounts from deletion.
- You can reassign content during deletion via a user ID.
Limitations
- Not tested on multisite.
- Counting posts across all CPTs uses a broad SQL query.
- Sites with very large user bases should paginate using Limit/Offset.
Changelog
1.0.0
- Initial release.
Releases
1 release.
These releases are tags only. The author does not attach a packaged zip, so there are no download counts to report.