PDA

View Full Version : Mass Delete Spammers Based on IP


q8mazad
06-05-2020, 09:26 AM
Hello

I found that there are thousands of unwanted posts / spammers members and they all have the same IP address

How do i mass delete members/post based on an IP address?

through the SQL query , I was able to get the userid , username through this line

select userid,username from post where ipaddress='x.x.x.x';

PinkMilk
06-05-2020, 09:52 AM
Remember to ALWAYS backup database before working on them!

DELETE FROM `post` WHERE `ipaddress=`'x.x.x.x';

q8mazad
06-05-2020, 10:33 AM
thanks for the quick reply to me

Actually I did it before
by created a file file.txt contains the below records

delete from post where userid=991;
delete from post where userid=992;
delete from post where userid=993;
delete from post where userid=994;
delete from subscribethread where userid=991;
delete from subscribethread where userid=992;
delete from subscribethread where userid=993;
delete from subscribethread where userid=994;
delete from thread where postusername ='XXA';
delete from thread where postusername ='XXB';
delete from thread where postusername ='XXC';

and run it
[root@vmi5 ~]# mysql vbdb < file.txt

is working , but I facing issue that i'm getting empty posts for the rest of the members.

I want a complete and correct way to completely delete the user from all fields,