Quickly find duplicate email addresses in the WordPress users table in the database so you can maintain a unique email address per user.
I have used this code snippet in countless projects over the years.
Membership sites do a good job of enforcing unique email addresses per WordPress user but sometimes duplicate email addresses can slip through the cracks.
This may be due to user migrations, data imports or custom registration forms.
If your site uses functions that assume each WordPress user has a unique email address, admins need to know what they are so they can be fixed.
I run the following code in a weekly cron job on my membership sites.
Modify the code for your own needs and let me know in the comments below if it was useful.