Post by tom327 » Wed Jan 11, 2023 12:28 am

I had hundreds of spam customer registrations and want to delete them.

Is it safe to delete customers directly in the Opencart database, without causing any issuers, errors, or messing things up?

I see there is a table named OC _Customer

My fear is there are connected tables to this one and just deleting rows form this table will cause some error.

Active Member

Posts

Joined
Thu Feb 16, 2012 7:33 am

Post by Durango95 » Wed Jan 11, 2023 1:12 am

Hello Tom327,

It's not the best thing to do.
In addition to the oc_customer table, there are 14 more tables related to the customer table.
By deleting these items directly in the oc_customer table, you will keep the relational records in the other tables. You can delete the customer and all relationships through the customer record itself.

tom327 wrote:
Wed Jan 11, 2023 12:28 am
I had hundreds of spam customer registrations and want to delete them.

Is it safe to delete customers directly in the Opencart database, without causing any issuers, errors, or messing things up?

I see there is a table named OC _Customer

My fear is there are connected tables to this one and just deleting rows form this table will cause some error.

Newbie

Posts

Joined
Tue Jan 10, 2023 9:17 pm

Post by OSWorX » Wed Jan 11, 2023 3:01 pm

Durango95 wrote:
Wed Jan 11, 2023 1:12 am
It's not the best thing to do.
In addition to the oc_customer table, there are 14 more tables related to the customer table.
Only partly correct.
If those "customers" registered themselves only, they can be simply deleted without any side affect.
Either through the shop backend or directly in the database.

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Guru Member

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by paulfeakins » Wed Jan 11, 2023 6:09 pm

OSWorX wrote:
Wed Jan 11, 2023 3:01 pm
If those "customers" registered themselves only, they can be simply deleted without any side affect.
Either through the shop backend or directly in the database.
Are you sure it doesn't add any related records in that case? What about address?

Anyway, to avoid these, you could consider our extension: https://www.opencart.com/index.php?rout ... er=antropy

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by JNeuhoff » Wed Jan 11, 2023 7:21 pm

As others have said, it's not enough to delete customer from the oc_customer. You'd also have to delete records with identical customer_id from these tables:
oc_address
oc_cart
oc_coupon_history
oc_customer_activity
oc_customer_affiliate
oc_customer_approval
oc_customer_history
oc_customer_ip
oc_customer_online
oc_customer_reward
oc_customer_transaction
oc_customer_search
oc_customer_wishlist
oc_order
oc_return
oc_review

If you are getting many fake account registrations, you can use our SpamBot Buster to prevent this from happening.

Override Engine * Integrated VQMod * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Rich Snippets * Google Tag Manager * Export/Import Tool * SpamBot Buster * Survey Plus


User avatar
Guru Member
Online

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by OSWorX » Wed Jan 11, 2023 7:52 pm

paulfeakins wrote:
Wed Jan 11, 2023 6:09 pm
OSWorX wrote:
Wed Jan 11, 2023 3:01 pm
If those "customers" registered themselves only, they can be simply deleted without any side affect.
Either through the shop backend or directly in the database.
Are you sure it doesn't add any related records in that case? What about address?
Yes, I am sure.
Right now tested and customer AND address is deleted when I delete those "customers" through the backend.

And as I said: IF they made no orders, removing them by doing as described above, works and need no additional extensions - sorry.

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Guru Member

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by paulfeakins » Thu Jan 12, 2023 1:22 am

OSWorX wrote:
Wed Jan 11, 2023 7:52 pm
through the backend.
Then you misunderstood as the OP was talking about removing them from the database directly.

tom327 wrote:
Wed Jan 11, 2023 12:28 am
Is it safe to delete customers directly in the Opencart database

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by OSWorX » Thu Jan 12, 2023 5:47 pm

paulfeakins wrote:
Thu Jan 12, 2023 1:22 am
OSWorX wrote:
Wed Jan 11, 2023 7:52 pm
through the backend.
Then you misunderstood as the OP was talking about removing them from the database directly.

tom327 wrote:
Wed Jan 11, 2023 12:28 am
Is it safe to delete customers directly in the Opencart database
Maybe ..
That's why I wrote that both methods will delete such fake registrations.
When done dircectly in the database (whikle I do not see any reason why doing so because it works perfectly when deleting them in the backend), the address table has to be cleaned also.
Which require an additional step, because those records deleted in the customer table has to be recorded (write in sheet e.g.) and then used to delete the address records.

Deleting fake customer through the backend require 1 step, doing it in the database 3 steps.

Selling extensions is one, but only when really needed ..

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Guru Member

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by paulfeakins » Thu Jan 12, 2023 10:14 pm

OSWorX wrote:
Thu Jan 12, 2023 5:47 pm
Deleting fake customer through the backend require 1 step, doing it in the database 3 steps.
But you can delete hundreds with one query ...

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by OSWorX » Thu Jan 12, 2023 10:57 pm

paulfeakins wrote:
Thu Jan 12, 2023 10:14 pm
OSWorX wrote:
Thu Jan 12, 2023 5:47 pm
Deleting fake customer through the backend require 1 step, doing it in the database 3 steps.
But you can delete hundreds with one query ...
Increasing the admin list limit to x (for this task) will also delete finally hundreds ;)

I guess we can say: OPs question is answered ..
Better for him to install an extension to avoid such registrations.

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Guru Member

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by paulfeakins » Fri Jan 13, 2023 12:36 am

Yes, good solutions indeed.

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom
Who is online

Users browsing this forum: openalvin and 24 guests