• Resolved David Innes

    (@david-innes)


    TL;DR: Is there a way to delete existing spam accounts? It looks like you can prevent new ones but this site lists 375 active users and… a lot of bogus ones.

    Details
    I’ve been asked to take over a fairly old PMP site. The database is ~600mb, 450mb in user_metadata.

    The user page reports 119k accounts are “potential spam checkouts.” It looks like after PMP 2.11 or so the previous dev used the new PMP options to prevent new spam checkout creations. But I obviously need a way to delete all the old bogus ones.

    Looking at abandoned-signups.php it looks like the “potential spam checkouts” column is inserted with JavaScript and there is no actual “role” for these bogus checkouts. So I can’t just go into the database and drop everyone with that bogus role the way one can drop all, e.g. Authors or Subscribers. Instead it looks like PMP creates a private, possible taxonomy.

    What’s the best way to clean the database of all these bogus users and their meta data?

    Note: I can privately provide a login and/or a zipped archive of the database with or without the zipped files.

    Thanks

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support Jarryd Long

    (@jarryd-long)

    Hi there, thank you for reaching out to the Paid Memberships Pro team. I’m sorry to hear that you’re faced with cleaning up this many spam accounts.

    We don’t have any bulk update/delete scripts available to delete spam users as we normally recommend deleting users from that list – this isn’t going to be possible with the large number you’re faced with.

    I’m going to put together a script that you could hook up to a cron job though and delete those users. This does come with its own set of warnings though because if a user has been marked as spam incorrectly for whatever reason, they’ll also be deleted. This however beats working through the list manually.

    Kind Regards,
    Jarryd
    Support Manager at Paid Memberships Pro

    Thread Starter David Innes

    (@david-innes)

    Tha would be wonderful, Jared. Thank you.

    For what it’s worth, visiting Dashboard -> Membership -> Members shows the ~375 actual active members. So if your script can query the database for subscribers who aren’t also members then we should be fine.

    Also, obviously, I can try your script on a copy of the site on my dev server to make sure none of the active members are removed.

    Plugin Support Jarryd Long

    (@jarryd-long)

    I’ve put this recipe together that queries the users that show in the Potential Spam Checkouts tab. We then check if they have a membership level or not and delete them.

    You can run this script by adding /wp-admin/?cleanup=1 to your browser or add it to a Cron so that it can run automatically. The script is set to loop through 500 users at a time however you can change this value to something that works for your site.

    https://gist.github.com/JarrydLong/198550c880c1cbb123fb046e111148ad

    A guide on how you can add this code to your site can be found at https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/#h-two-methods-to-add-custom-code-to-pmpro

    Kind Regards,
    Jarryd
    Support Manager at Paid Memberships Pro

    Thread Starter David Innes

    (@david-innes)

    Thanks, Jared! It works like a charm. Good script. It’ll have to run 500+ times to clear out all the old accounts, but that’s what cron’s for. Thanks again.

    Thread Starter David Innes

    (@david-innes)

    Final followup. The script definitly worked like a charm. It took a while to clear out more than 100,000 spam users but the database is now a healthy 90mb instead of more than 360mb! So thanks, Jarryd!

    Plugin Support Jarryd Long

    (@jarryd-long)

    I’m so glad to hear this has helped, David. Feel free to reach out if there’s anything else we can assist with.

    If you’re enjoying Paid Memberships Pro, would you consider leaving a 5-star review?

    Your feedback helps other people who want to use PMPro, especially if you can include details about specific features that you’ve found valuable for your membership site.

    Here’s the link to create a new review https://www.ads-software.com/support/plugin/paid-memberships-pro/reviews/

    Kind Regards,
    Jarryd
    Support Manager at Paid Memberships Pro

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How to drop ~119 thousand “potential spam checkouts?”’ is closed to new replies.