Your user list grows in one direction only
Every opt-in form, every checkout, every free download adds a user to your WordPress database. Very few get removed. A year of moderate traffic and you have hundreds or thousands of accounts that have never logged in a second time, customers who bought once two years ago, and subscribers who have not opened an email since the first welcome message.
That bloat costs you in two ways. Deliverability suffers when you email addresses that never engage, which hurts sender reputation for the people who do open your messages. And any inactive account with a weak password is a liability, because bots cycle credential dumps against sites of every size.
What most people do
wp_users, wp_usermeta, wp_posts, and wp_comments to derive a "last activity" date is doable, but fragile: wrong role exclusions or a missing meta key and you delete active customers.A better way: one command, four activity signals
TrueCommander's find inactive users command combines every available signal for last activity into a single ranked list. It is honest about what it knows and what it doesn't: the trc_last_login meta is populated on wp_login only from the moment TrueCommander was installed, so on a fresh install it falls back to posts, comments, and registration date automatically.
The login signal is honest about its limits. trc_last_login is written on every wp_login event, but only from the point TrueCommander was installed. For users who have not logged in since then, the command falls back to latest authored post, then latest approved comment, then user_registered. Those fallbacks are always present, so every user gets a best-available activity date, not a blank.
How it works
trc_last_login meta (populated by TrueCommander on wp_login), the date of their latest published or draft post, the date of their latest approved comment, and user_registered as a guaranteed floor. The most recent of those four is the activity date.-role to narrow to a single role (for example customer or subscriber), or pass -exclude_roles to exclude additional roles by slug. The two parameters combine, so you can scan all non-admin, non-editor accounts in one pass.| Parameter | What it does |
|---|---|
-days | Users whose most recent detected activity is older than this many days are included in the results. Required. |
-role | Limit the scan to a single role slug (for example subscriber or customer). Omit to scan all roles except those in -exclude_roles. |
-exclude_roles | Comma-separated list of role slugs to skip. Defaults to administrator. You can extend the default: -exclude_roles=administrator,editor,shop_manager. |
-limit | Maximum number of users to scan. Default 500, max 10000. On large sites, raise this or combine with -role to keep the query fast. |
| Can be used in |
Real example
You are preparing a newsletter to your subscriber list and your email tool flags that your open rate has been declining for three months. You suspect you are mailing to a lot of dead addresses and people who signed up once and forgot about you.
You run tp find inactive users -days=180 -role=subscriber. The command returns 847 subscribers with no detected activity in the last six months. You pipe the list into a win-back macro that sends a single re-engagement email. Anyone who does not open or click over the next two weeks gets tagged with assign user tag for removal.
Your list drops from 3,200 to 2,100 active subscribers. The next newsletter hits a 28% open rate instead of 14%, and your deliverability score recovers within two sending cycles.
Goes further with TrueCommander
assign user tag to mark every inactive user with a "re-engage" tag. Your email tool or CRM can then target exactly that segment without a manual export.find inactive users, tags the results, and calls a webhook to trigger your email sequence. One click handles the whole re-engagement pipeline.find inactive users on a monthly schedule so you always have a fresh picture of list health without remembering to check. Pair with get user meta to enrich the output.