Jump to content

Bulk delete 'bot created' customers


CoderJim

Recommended Posts

Like many others I have been deluged with bogus 'customers' created by bots and mechanical turks, I see a possible solution in a past post (2/3/16) by member avyona where they said they had used this code in their phpMyAdmin to clean the DB...

"DELETE FROM `CubeCart_customer` WHERE order_count  =  0 AND registered < 1460000000;

or even better:

DELETE FROM `CubeCart_customer` WHERE order_count  =  0;

It will clean house in a second!"

Has anyone tried this with the current 6.2.2 CC Foundation and/or is this a risky move?

Thanks

Jim

Link to comment
Share on other sites

I have modded a CC6 store such that in the Customer List, there is a checkbox on each line and a "Do this for each selected..." drop-down selector.

Depending how many bogus customers you wish to delete, that is to say, how long this has been happening and how much you have let accumulate, it could take you five to twenty minutes to clear them out.

Plus, a simple edit to index.php will test for a few key aspects of these form submissions and then tell PHP to simply die.

 

Link to comment
Share on other sites

The second sql statement will delete all records in the customer table that have never placed an order.  The first is a variation that deletes the same but only when they were registered before a specific time

1 hour ago, CoderJim said:

is this a risky move?

Implementing sql statements that delete records without knowing what they do would always be risky !

Link to comment
Share on other sites

I went one step further on one of my sites.

By exporting the customer and also the address table, I could identify which customers had never purchased then cross reference these to thier address entries.

Delete both and import the tables back in.

Using PHP my admin, you could narrow these down to anything, say prior to 12 months ago, and only delete the customers who registered and never purchased say prior to 2018.

 

One thing I would suggest, is using PHPMyadmin, make a copy of the table and work on the copy.

 

Link to comment
Share on other sites

  • 2 weeks later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...