• Hi,

    This is a relatively advanced question.

    We have a WordPress site (more of a CMS than a blog) which has 10,000+ users, some contributors, some just subscribers.

    Users “Opt in” or “opt out” to receive messages from us about their accounts. These transactional emails are delivered by another app we have developed, which tracks email bounces and opens.

    Last time we emailed all users, over 300 email addresses hard bounced, and we want to remove those users and all posts / comments etc they have left in a manageable way.

    so the question is: Is there a way to bulk delete users from a list of email addresses? What would be the best way to achieve this other than searching one-by-one for the address and pressing delete 300+ times?

    Just wondering if anyone has done something similar so that we could amend the code for it rather than reinventing the wheel.

    We’d want to:

    1) Drop in a list of “Bounced” email addresses;
    2) For each, Find the WP User account;
    3) Delete that account;
    4) Delete all posts / comments left by that account;
    5) Remove any relationships which may exist relating to that user account.

    Any thoughts from the community on this? Or is there a plugin which achieves similar results?

Viewing 4 replies - 1 through 4 (of 4 total)
  • I would write something to do it following pretty much exactly the pattern you presented. It looks like 3, 4, and 5 are all handled by wp_delete_user(…) so it should be pretty simple.

    Thread Starter robscott

    (@robscott)

    Yes – makes sense, really wondering if there is a similar plugin out there! I wouldn’t be surprised if there was not, though, as there’ll be few people with this exact set of requirements…

    … as there’ll be few people with this exact set of requirements…

    ?? That is a concept too few people grasp. ??

    Your requirement to delete people by email probably isn’t too unusual though.

    Thread Starter robscott

    (@robscott)

    ?? That is a concept too few people grasp. ??

    Unfortunately, that’s the ego-centric world we live in! My problems, obviously, are so important, they must be everyone’s problem…

    I’m sure I can bottom this one out at some point in the next week or two. I just wanted to do it the lazy way, where someone else drifted in with precisely the code I required ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Mass Deleting Users from Email List’ is closed to new replies.