Duplicate WooCommerce customer accounts, same email
Two customer accounts registered with the same email address: WordPress is meant to prevent that at the application level, so when it happens anyway it’s almost always the trace of an import, a migration, or a login plugin that created a parallel account instead of matching the one that already existed.
How I go about it
-
Spotting the duplicates
I query wp_users and wp_usermeta to list email addresses that show up against several user IDs, and cross-check them against the orders tied to each account to size the actual problem.
-
Tracing the origin
I check whether the accounts came from a CSV import, a migration from another platform, or a social-login plugin recreating an account instead of matching the existing email.
-
Deciding case by case
A guest account created at checkout, followed later by a real account opened with the same email, isn’t the same as an import duplicate: the guest order has no user ID to merge, it needs relinking a different way.
-
Cleaning up or merging
Depending on the case, I remove the unnecessary account, or relink the relevant order history to the right account by correcting the customer_id attached to each order.
-
Closing the entry point
I fix the registration form, the account-creation-at-checkout setting, or the plugin configuration at fault, so the duplicate doesn’t reappear on the next customer.
What I handle regularly
- A customer complains about not finding their past orders when logging in
- Two separate customer records exist with exactly the same email address
- Duplicates appeared right after a customer import or a migration from another store
- A social-login plugin creates a new account on every login instead of recognising the customer
- The number of customer accounts no longer matches the expected number of orders
Where these duplicates come from
WordPress assumes that one email address matches one account: the user_email column in the wp_users table is meant to stay unique at the application level. A genuine duplicate rarely comes from a WordPress bug itself, but from a tool that inserted a new row without first checking whether a user already existed with that email.
The most common case in a shop: a customer places a first order as a guest, then later comes back and creates a real account with the same address. WooCommerce doesn’t automatically link the two histories into one account unless the "Allow customers to create an account during checkout" setting and its matching logic are configured carefully.
Bulk customer imports also create duplicates when the import tool inserts a row per customer without querying the database first to see if the email already exists. A custom registration form from a theme or plugin that bypasses the usual wp_create_user() checks can produce the same result.
Related pages
Describe your need in one minute
A few targeted questions so I can reply with an estimate rather than another questionnaire.