[Skip to main content](#vessel-content)

#   Delete spam users hikashop

##

- **[girish.tiwaricb](/forum/user/40697-girish-tiwaricb "View girish.tiwaricb's Profile")**
- [![girish.tiwaricb's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/40697-girish-tiwaricb "View girish.tiwaricb's Profile") Topic Author
- [ Offline](/forum/user/40697-girish-tiwaricb)

Less More

- Posts: 37
- Thank you received: 0
-
-

8 years 10 months ago [\#283969](#283969) by [girish.tiwaricb](/forum/user/40697-girish-tiwaricb "View girish.tiwaricb's Profile")  *[Delete spam users hikashop](/forum/33-customers/893088-delete-spam-users-hikashop#283969 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.4.8 -- PHP version -- : 5.6.3  We have a hikashop store where we have total number of orders as 10854 but the total number of customers are 118555 which means there are a lot of spam users present in DB. Now, we have integrated captcha to prevent the spam in future.  We need to know the way of deleting the Hikashop users who have registered but didn't placed any orders in past 1 month. Could you please assist here. If you can share DB query to fetch &amp; delete the users, it will also be helpful.")* was created by *[girish.tiwaricb](/forum/user/40697-girish-tiwaricb "View girish.tiwaricb's Profile")*

-- HikaShop version -- : 2.3.5
-- Joomla version -- : 3.4.8
-- PHP version -- : 5.6.3

We have a hikashop store where we have total number of orders as 10854 but the total number of customers are 118555 which means there are a lot of spam users present in DB. Now, we have integrated captcha to prevent the spam in future.

We need to know the way of deleting the Hikashop users who have registered but didn't placed any orders in past 1 month. Could you please assist here. If you can share DB query to fetch &amp; delete the users, it will also be helpful.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2N1c3RvbWVycy84OTMwODgtZGVsZXRlLXNwYW0tdXNlcnMtaGlrYXNob3A/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86283
- Thank you received: 14263
-
-

8 years 10 months ago [\#283974](#283974) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Delete spam users hikashop](/forum/33-customers/893088-delete-spam-users-hikashop#283974 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.4.8 -- PHP version -- : 5.6.3  We have a hikashop store where we have total number of orders as 10854 but the total number of customers are 118555 which means there are a lot of spam users present in DB. Now, we have integrated captcha to prevent the spam in future.  We need to know the way of deleting the Hikashop users who have registered but didn't placed any orders in past 1 month. Could you please assist here. If you can share DB query to fetch &amp; delete the users, it will also be helpful.")*

Hi,

You can use the mass action system for that:

You can for example create a mass action like that to delete all the customers without a confirmed order :
[ monosnap.com/file/JhFLXjNCpnxc9rAKKuUUNG7i5E5nyA](https://monosnap.com/file/JhFLXjNCpnxc9rAKKuUUNG7i5E5nyA)
There is no way to set a "more than 1 month old" condition there though.
Actually, if you don't set any filter, it will delete only the users without an order as HikaShop will refuse to delete users with orders. The orders would have to be deleted first.
And note that while this will delete the "customer" entry in HikaShop, it won't delete the user account in Joomla (but "guest" users will be completely removed).

If you want to do it in MySQL and supposing that you want to delete the user accounts from Joomla, you'll have to have a DELETE query on the joomla users table with joins to the hikashop_user table on the users.id = hikashop_user.user_cms_id and on the hikashop_order table on the hikashop_user.user_id = hikashop_order.order_user_id, and a condition on hikashop_order.order_status if you want to take into account only non confirmed OR shipped orders, and a condition on hikashop_order.order_created if you want to have a "only less than 1 month old orders" condition.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2N1c3RvbWVycy84OTMwODgtZGVsZXRlLXNwYW0tdXNlcnMtaGlrYXNob3A/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[girish.tiwaricb](/forum/user/40697-girish-tiwaricb "View girish.tiwaricb's Profile")**
- [![girish.tiwaricb's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/40697-girish-tiwaricb "View girish.tiwaricb's Profile") Topic Author
- [ Offline](/forum/user/40697-girish-tiwaricb)

Less More

- Posts: 37
- Thank you received: 0
-
-

8 years 10 months ago [\#284029](#284029) by [girish.tiwaricb](/forum/user/40697-girish-tiwaricb "View girish.tiwaricb's Profile")  Replied by *[girish.tiwaricb](/forum/user/40697-girish-tiwaricb "View girish.tiwaricb's Profile")* on topic *[Delete spam users hikashop](/forum/33-customers/893088-delete-spam-users-hikashop#284029 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.4.8 -- PHP version -- : 5.6.3  We have a hikashop store where we have total number of orders as 10854 but the total number of customers are 118555 which means there are a lot of spam users present in DB. Now, we have integrated captcha to prevent the spam in future.  We need to know the way of deleting the Hikashop users who have registered but didn't placed any orders in past 1 month. Could you please assist here. If you can share DB query to fetch &amp; delete the users, it will also be helpful.")*

Hi,

Thanks for the update here. So, if we just want to delete the cusotmers (leave joomla users) who never placed any orders and if we choose mass actions, then how we can make sure that the guest users will not be deleted? Is there any way to keep them from mass actions delete?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2N1c3RvbWVycy84OTMwODgtZGVsZXRlLXNwYW0tdXNlcnMtaGlrYXNob3A/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86283
- Thank you received: 14263
-
-

8 years 10 months ago [\#284042](#284042) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Delete spam users hikashop](/forum/33-customers/893088-delete-spam-users-hikashop#284042 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.4.8 -- PHP version -- : 5.6.3  We have a hikashop store where we have total number of orders as 10854 but the total number of customers are 118555 which means there are a lot of spam users present in DB. Now, we have integrated captcha to prevent the spam in future.  We need to know the way of deleting the Hikashop users who have registered but didn't placed any orders in past 1 month. Could you please assist here. If you can share DB query to fetch &amp; delete the users, it will also be helpful.")*

Hi,

Yes. The guest users have their user_cms_id column at 0 in the hikashop_user table.
So in your mass action, you can add a filter on that column being different from 0 and it will only target customers with a user account.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2N1c3RvbWVycy84OTMwODgtZGVsZXRlLXNwYW0tdXNlcnMtaGlrYXNob3A/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[serbofleconcepts](/forum/user/37141-serbofleconcepts "View serbofleconcepts's Profile")**
- [![serbofleconcepts's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar37141.gif)](/forum/user/37141-serbofleconcepts "View serbofleconcepts's Profile")
- [ Offline](/forum/user/37141-serbofleconcepts)

Less More

- Posts: 158
- Thank you received: 5
-
-

4 years 5 months ago [\#341392](#341392) by [serbofleconcepts](/forum/user/37141-serbofleconcepts "View serbofleconcepts's Profile")  Replied by *[serbofleconcepts](/forum/user/37141-serbofleconcepts "View serbofleconcepts's Profile")* on topic *[Delete spam users hikashop](/forum/33-customers/893088-delete-spam-users-hikashop#341392 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.4.8 -- PHP version -- : 5.6.3  We have a hikashop store where we have total number of orders as 10854 but the total number of customers are 118555 which means there are a lot of spam users present in DB. Now, we have integrated captcha to prevent the spam in future.  We need to know the way of deleting the Hikashop users who have registered but didn't placed any orders in past 1 month. Could you please assist here. If you can share DB query to fetch &amp; delete the users, it will also be helpful.")*

I had the same issue and I used the mass action tool to get rid of all but Customers with orders. This deleted over 260000 Hikashop users, but they are still showing up in the SQL database. How do I get rid of these please? Which field do I need to use in the Db?

Thank you.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2N1c3RvbWVycy84OTMwODgtZGVsZXRlLXNwYW0tdXNlcnMtaGlrYXNob3A/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86283
- Thank you received: 14263
-
-

4 years 5 months ago [\#341395](#341395) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Delete spam users hikashop](/forum/33-customers/893088-delete-spam-users-hikashop#341395 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.4.8 -- PHP version -- : 5.6.3  We have a hikashop store where we have total number of orders as 10854 but the total number of customers are 118555 which means there are a lot of spam users present in DB. Now, we have integrated captcha to prevent the spam in future.  We need to know the way of deleting the Hikashop users who have registered but didn't placed any orders in past 1 month. Could you please assist here. If you can share DB query to fetch &amp; delete the users, it will also be helpful.")*

Hi,

Well, if you deleted these users in hikashop_user then they are not there.
Do you mean that they still show up in Joomla's user manager ?
Please provide more details on the situation.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2N1c3RvbWVycy84OTMwODgtZGVsZXRlLXNwYW0tdXNlcnMtaGlrYXNob3A/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[serbofleconcepts](/forum/user/37141-serbofleconcepts "View serbofleconcepts's Profile")**
- [![serbofleconcepts's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar37141.gif)](/forum/user/37141-serbofleconcepts "View serbofleconcepts's Profile")
- [ Offline](/forum/user/37141-serbofleconcepts)

Less More

- Posts: 158
- Thank you received: 5
-
-

4 years 5 months ago [\#341401](#341401) by [serbofleconcepts](/forum/user/37141-serbofleconcepts "View serbofleconcepts's Profile")  Replied by *[serbofleconcepts](/forum/user/37141-serbofleconcepts "View serbofleconcepts's Profile")* on topic *[Delete spam users hikashop](/forum/33-customers/893088-delete-spam-users-hikashop#341401 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.4.8 -- PHP version -- : 5.6.3  We have a hikashop store where we have total number of orders as 10854 but the total number of customers are 118555 which means there are a lot of spam users present in DB. Now, we have integrated captcha to prevent the spam in future.  We need to know the way of deleting the Hikashop users who have registered but didn't placed any orders in past 1 month. Could you please assist here. If you can share DB query to fetch &amp; delete the users, it will also be helpful.")*

My mistake, I had left the limitation field in the mass action set to the default value so it was only looking at the first 500 records!

Deleting 260,000 users took quite a while.

The following user(s) said Thank You: [nicolas](/forum/user/63-nicolas "View nicolas's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2N1c3RvbWVycy84OTMwODgtZGVsZXRlLXNwYW0tdXNlcnMtaGlrYXNob3A/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop- Install &amp; Update- Product &amp; Category Display- Content Creation- Sales and Orders- - Orders management- - Reports &amp; Statistics- Customers- Checkout- Payment Methods- Shipping Methods- Import &amp; Export (CSV, XLS…)- Specific Features- - Affilation- - Taxes- - Wishlist- - Vote- - Carousel &amp; Slider- - Mass Actions- - Filters &amp; Search- - Discount &amp; Coupon- - Feature Request- Integrations- Showcase- General Talk about HikaShop- Development- - HikaShop 3.0 Beta- Translation- Commercial Jobs HikaShop Components- HikaMarket- - Market: Feature requests- - Market: How to?- - Market: Bug Report- HikaSerial- - General talk about HikaSerial- - Serial: Bug Report- - Serial: How to?- - Support en Français de HikaSerial (French Support)- - HikaSubscription- HikaAuction- - Auction: Feature requests- - Auction: How to?- - Auction: Bug report Hikashop around the world- Support en Français (French Support)- Russian- - FAQ. Курс выживания с Hikashop. Частые вопросы и о- - Расширения Hikashop- - Наши сайты на Hikashop- 日本語版サポート(Japanese Support)- Thai- German Archives- Bug Report- How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.263 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)

[](#top)
