This is how to remove deceased members from social groups

alfa1

Well-Known Member
@truonglv gave me this query which worked very well :
Code:
DELETE team_member.*
FROM xf_team_member AS team_member
LEFT JOIN xf_user AS user ON (user.user_id = team_member.user_id)
WHERE FIND_IN_SET('user_group_id_to_delete', user.secondary_group_ids)
This removes all members in the usergroup from all social groups.
This is useful for when you have a usergroup for deceased members.
 
Back
Top