cancel
Showing results for 
Search instead for 
Did you mean: 

Removing customers manually from MySQL database

   Did you know you can see the translated content as per your choice?

Translation is in progress. Please check again after few minutes.

Removing customers manually from MySQL database

Hello,

 

Can anyone tell me how I can remove customers manually from MySQL database,

 

I am really desperate as I have to remove more than 30000+ customers because of spam users registration.

 

I am pretty it is not that difficult and would really need to know how.

 

Can I remove also a block of customers, like customer 20000 to 21000 with one line of code or have to do multiple.

 

Thanks a lot,

 

J Lachance

9 REPLIES 9

Re: Removing customers manually from MySQL database

@jean-francois_l

 

You can delete the customer and customer address in customer_entitycustomer_address_entiy

 

once you delete customers you have to run reindex command as follows:

 

php bin/magento indexer:reindex

Manish Mittal
https://www.manishmittal.com/

Re: Removing customers manually from MySQL database

Hello, thank you for the prompt answer.

 

Would you happen to know if there is a way to filter the customers to delete by email address...

 

over 10 000 registrations come from a chinese ISP called qq.com

Email address of those spam registrations always end with qq.com

 

Is there a way to filter this...

 

Best regards,

 

J Lachance

Re: Removing customers manually from MySQL database

@jean-francois_l

 

Run below query to filter:

 

SELECT * FROM customer_entity where email like "%qq.com%";

Manish Mittal
https://www.manishmittal.com/

Re: Removing customers manually from MySQL database

Hello @jean-francois_l,

 

Please run below MySQL query for delete customer which have qq.com characters in email address 

DELETE FROM `customer_entity` WHERE email like "%qq.com%";

 

--
If my answer is useful, please Accept as Solution & give Kudos

Re: Removing customers manually from MySQL database

@jean-francois_l

 

Please let me know still if you face any issue

Manish Mittal
https://www.manishmittal.com/

Re: Removing customers manually from MySQL database

Hello @Manish Mittal,

 

Please check question, He/She want to delete customer data not listed all customer data. 

 

Your query doesn't delete customer data. So Please check before a given answer of the question.

 

--
If my answer is useful, please Accept as Solution & give Kudos

 

Re: Removing customers manually from MySQL database

@gelanivishal

 

He asked how to filter with email and I have shared select query to filter.

Manish Mittal
https://www.manishmittal.com/

Re: Removing customers manually from MySQL database

Did you ask this question? Why are you overreacting?

First check his question then tell me

Re: Removing customers manually from MySQL database

-Re  Removing customers manually from MySQL databas... - Magento Forums.png

 

For your reference. And second thing here we are helping others so please mind your language.

Manish Mittal
https://www.manishmittal.com/