Sign inBlogSupportContact
WooCommerce

Filter WordPress and WooCommerce users by role, location, or purchase history

Every customer who bought product X but never came back. Every subscriber who registered last month. Every user in Germany who spent over $500. Find them, act on them.

5 min read May 2026 filter user

Your customer list is a flat table. You need segments.

Marketing wants "everyone who's made 3+ purchases this year." Legal wants "every German user so we can send the GDPR compliance email." Support wants "every customer who bought the recalled product." WordPress gives you a flat Users page sorted by registration date. Segmentation means exporting and filtering manually.

Worse, you can't act on those segments without another round of work: copy email addresses into a campaign tool, run a SQL query, re-export after every change.

What most people do instead

Export users to CSV, filter in spreadsheetData is stale immediately. Purchase history requires joining WooCommerce tables by hand.
Write custom WP_User_Query + wc_get_ordersNeeds developer time for each new segment. Joining purchase history is non-trivial.
Sync users to Mailchimp or KlaviyoExtra service. Extra cost. Data sync delays. Personal info leaves your stack.

A better way: WordPress + WooCommerce filters in one command

Run filter user with WordPress criteria (role, registration date) and WooCommerce criteria (spend total, order count, country). Each matching user comes with their purchase history, profile meta, and role. Pipe into macros for bulk email, tagging, or CSV export.

TrueCommander
Filter user
42 users match
42
Matches
$38k
Total spend
avg $904
Per user
Anna Mueller · anna.m@example.de · 7 orders$1,240
Klaus Schmidt · k.schmidt@example.de · 4 orders$890
Lena Weber · l.weber@example.de · 12 orders$2,410

WooCommerce purchase history included. Each matching user comes with total spend, order count, and last purchase date — fields you can reference in the next macro step as {{step1.total_spend}}, {{step1.last_order_date}}, etc.

How it works

The command builds a WP_User_Query for WordPress-native filters (role, registration date, capability), then joins WooCommerce order data for spend-based filters. Results include full user details plus aggregated purchase history.

1
Pick WordPress filtersRole, registration date, capability
2
Add WooCommerce filtersTotal spend, order count, country, last purchase, product bought
3
Loop with for_each for bulk actionsSend an email per user, update user meta per user, export to CSV
ParameterValue
-roleWordPress role: customer, subscriber, editor, etc.
-registered_from / -registered_toRegistration date range
-countryWooCommerce billing country (ISO code: DE, US, GB)
-spend_min / -spend_maxTotal spend threshold (WooCommerce only)
-orders_minMinimum number of orders
-bought_productUsers who purchased a specific product ID
Can be used in

Real example

You're launching a VIP loyalty program for customers who've spent over $1,000 lifetime. You need to email them an invite, tag them in your database, and push them to your CRM.

Macro step 1: filter user -role=customer -spend_min=1000. Result: 87 users. Step 2 with for_each: for each user, send a template email with their name, total spend, and a unique discount code. Step 3 with for_each: update user meta with vip_tier=gold. Step 4 with for_each: call the HubSpot API to tag them as "VIP-Gold".

One macro run. Three actions per user. Eighty-seven VIPs enrolled in four minutes.

Goes further with TrueCommander

Ready?

Turn your user list into segments.

This is one of 91 commands. All included with every license.

Cookies. The short version.

Essential cookies keep the cart and theme working. Analytics only fire if you say yes. Read our policy.