2

Any EE folks know if there is a way to delete all member accounts that have no channel entries assigned to them?

In my case any accounts with 0 entries would be spam.

Thanks for your time.

5

If you're comfortable doing this directly in the database, these are SQL queries that delete all members who are not authors of channel entries:

delete from exp_members where member_id not in (select author_id from exp_channel_titles);

delete from exp_member_data where member_id not in (select author_id from exp_channel_titles);

delete from exp_member_homepage where member_id not in (select author_id from exp_channel_titles)

Be sure to backup your database first!!! Just in case.

(Also, I assume you meant "authors" when you describe entries assigned to members. Is this correct?)

1
  • yes, authors is correct, thanks for clarifying
    – mjr
    Sep 16 '13 at 19:20
0

You can delete all those members with single SQL:

DELETE exp_members, exp_member_data, exp_member_homepage FROM exp_members 
INNER JOIN exp_member_data 
INNER JOIN exp_member_homepage 
WHERE exp_member_data.member_id = exp_members.member_id 
AND exp_members.member_id = exp_member_homepage.member_id 
AND exp_members.total_entries = 0

I would suggest you to take database backup first.

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.