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.
ExpressionEngine® Answers is a question and answer site for administrators, end users, developers and designers for ExpressionEngine® CMS. It only takes a minute to sign up.
Sign up to join this communityIf 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?)
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.