WHMCS guide

Find the fake signups in your WHMCS.

Card testers and spam bots open account after account with the same mailbox, adding a +tag and a new name each time. On our own US install the first query below found 186 mailboxes behind 617 client accounts. 545 of them placed an order. Not one ever paid an invoice.

DMS.S2 — Before you start

Before you run anything.

Read only

Every query below is a SELECT. It changes nothing. Run it in phpMyAdmin or the mysql client, on a copy of the database if you have one.

A match is a lead, not a verdict

An agency can open accounts for its own clients with +tags on one mailbox, and our Brazilian install shows exactly that. Query 4 tells a paying customer from a tester.

Do not merge them

Merging fake accounts into one keeps their orders and invoices around. Close or delete them after you check query 4.

DMS.S3 — The queries

Four ways to find them.

One mailbox, a different name on every account

Ignores +tags on any provider and dots on Gmail. Listed only when at least one account uses a +tag and no two accounts share a last name.

SELECT CONCAT(IF(SUBSTRING_INDEX(LOWER(TRIM(email)), '@', -1) = 'gmail.com',
                 REPLACE(SUBSTRING_INDEX(SUBSTRING_INDEX(LOWER(TRIM(email)), '@', 1), '+', 1), '.', ''),
                 SUBSTRING_INDEX(SUBSTRING_INDEX(LOWER(TRIM(email)), '@', 1), '+', 1)),
              '@', SUBSTRING_INDEX(LOWER(TRIM(email)), '@', -1)) AS mailbox,
       COUNT(*) AS accounts, GROUP_CONCAT(id ORDER BY id) AS client_ids
FROM tblclients
GROUP BY mailbox
HAVING COUNT(*) > 1 AND SUM(email LIKE '%+%') > 0
   AND COUNT(DISTINCT LOWER(TRIM(lastname))) = COUNT(*);

Three or more signups from one IP in a day

WHMCS saves the signup IP on each client. A family or an office behind one router can show up here too, so open the accounts before you act.

SELECT ip, DATE(datecreated) AS day, COUNT(*) AS signups,
       GROUP_CONCAT(id ORDER BY id) AS client_ids
FROM tblclients
WHERE ip <> ''
GROUP BY ip, day
HAVING COUNT(*) >= 3
ORDER BY day DESC;

Days with a spike of declined payments

Card testing shows up in the gateway log as many declines in one day. The result text depends on the gateway: Stripe logs Declined, others log Failed, so check Billing > Gateway Log for the words yours uses.

SELECT DATE(date) AS day, gateway, COUNT(*) AS declined
FROM tblgatewaylog
WHERE result IN ('Declined', 'Failed')
GROUP BY day, gateway
HAVING COUNT(*) >= 5
ORDER BY day DESC;

Did those accounts ever pay?

Paste the client IDs from query 1 or 2. A tester places orders and pays nothing; an agency account has paid invoices.

SELECT c.id, c.status, c.datecreated,
       (SELECT COUNT(*) FROM tblorders o WHERE o.userid = c.id) AS orders,
       (SELECT COUNT(*) FROM tblinvoices i WHERE i.userid = c.id AND i.status = 'Paid') AS paid_invoices
FROM tblclients c
WHERE c.id IN (101, 102, 103);

DMS.S4 — The addon

Or see query 1 inside the WHMCS admin.

Brasa Duplicate Clients finds one mailbox behind unrelated names, including Gmail dots and +tags, lists those groups last as possible fake signups and e-mails admins when a new group appears. Queries 2 to 4 are not in the addon. It never merges or deletes anything.

Brasa Duplicate Clients screen in the WHMCS admin, with sample data

Brasa Duplicate Clients

$39 per year

Finds the accounts that look like the same person or company, so you can merge the right ones.

  • Same mailbox, ignoring capital letters, +tags and Gmail dots
  • Same tax ID, same name and phone, same name and postcode
  • Each group shows services, open invoices and credit, and which account to merge into
  • One mailbox behind unrelated last names is listed last, as possible fake signups
First run in 16 seconds, on sample data: the summary, then each group of accounts with the one to keep. Brasa Duplicate Clients on the WHMCS Marketplace
Buy for $39

DMS.S5 — Questions

Cleaning up and keeping them out.

Should I delete the fake accounts or close them?

Close accounts that have invoices or orders you want to keep for your records, and delete the empty ones. Before either, run query 4: an account with a paid invoice is a real customer.

How do I stop new fake signups in WHMCS?

In Configuration > System Settings > General Settings > Security, pick reCAPTCHA v3 or hCaptcha as the Captcha Type, the type WHMCS recommends against spam orders, and tick Shopping Cart Checkout and Client Registration under Captcha for Selected Forms. A fraud check module on orders adds a second gate.

Why does WHMCS let one e-mail open many accounts?

It does not: WHMCS refuses an e-mail already in use. The +tag makes each address different to WHMCS while the mail still lands in one inbox, which is why query 1 strips it.