2

Got hacked! One of my client sites was hacked about 6 months ago. They got into the member pages and created 3,900 pages of members. I can delete them one page at a time. but it will take be days to get through them. Is there a work around can access the file or the use myPHP Admin? The member groups are either 'Members" or 'Pending'. There are only one member groups that I need and that is the 'Super Admin"

Thanks

  • 1
    That's not technically being hacked. Sounds like you've been 'spammed'. There's a huge difference I think. I always make sure I add this line to config.php: $config['profile_trigger'] = md5(mt_rand()); – Jim Pannell May 21 '13 at 9:24
8

If you'd prefer not to do this through a SQL query, you can also get the member list in the control panel to show more members on a page.

Go to the member list page in the CP and add these parameters to the end of the URL:

&group_id=4&perpage=1000

Make sure you check that the group_id parameter matches the group you want to view.

If you're using this to delete members through the control panel, it will only delete 1000 members at a time. So even if you set the "perpage" parameter to 5000 and select all of those members to delete, it will only delete the first 1000.

  • Thanks, I think I will use prefer to not go through a SQL query. This seems to work great. Thanks – seeingis May 21 '13 at 14:22
  • @seeingis If this answer worked, please mark it as correct. – Stephen Callender Sep 8 '13 at 7:21
  • That is a fantastic trick! – Marketing Alliance Aug 9 '18 at 16:23
6

You will need to delete the same member records from "exp_member_data" tables also.

You can use this SQL query and can run from PHPMYADMIN like

DELETE exp_members, exp_member_data 
FROM exp_members 
LEFT JOIN exp_member_data ON exp_member_data.member_id = exp_members.member_id 
WHERE exp_members.group_id = 5

This query will delete all the member records having group id as 5 from both tables exp_members and exp_member_data. You can change group id according to your preference and also can put more conditions in WHERE.

I would suggest you to take database backup before running the SQL.

3

First of all back up the database.

Then if you know that they are all fake then you can run an SQL query like:

DELETE
FROM `exp_members`
WHERE `group_id` = x
WHERE last_visit = 0

Where group_id would be the member group and you're also checking for last visit as an extra safety net so you're not deleting your own Super Admin account or any member accounts which have been logged into.

Just use with caution and always back-up first. Double-check that you know which members are real and fake and that you have a way to distinguish in the filtering.

1

If this isn't a membership-based site and you only have 1 or a few legit admin accounts, another quick solution is to (after 1st backing up the db), go into exp_members table in phpMyAdmin, select member_id 1 (this is super admin) and optionally member_id 2 (& 3, etc) and then Export those entries to file. On the same table, go to Operations tab, then select Empty the table (TRUNCATE). Finally, re-import the file you just exported. Do the same for member_data table, and you are back in business.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.