At some time our CiviCRM/Drupal installation has had lots of spam accounts created. As these are over a period of time I can't isolate by date. One tell-tail sign that the accounts are spam is their Civi contact summary has no recorded touch points (activity, contributions, memberships and events). Is there a way to search for contacts that meet this criteria and delete? I've looked at the Find Contacts - Advanced Search but there doesn't appear to be an option for null values. I've also looked at modifying one of the Contact Report Templates which does allow null matches but haven't been able to find a setting that gives the spam accounts.

3 Answers 3


You could find them via groups (or tags) and the custom include/exclude search.

If you have always used CiviCRM for everything then I think you should only need two groups or tags:

  • All contacts
  • All contacts with activities (as activites are created for contributions, membership and events)

If you have migrated data from a previous system or imported contributions, memberships or event participants then you may need to create groups or use appropriate tags for the all of the following:

  • All contacts
  • All contacts who have made contributions
  • All contacts who have memberships
  • All contacts who have registered for events
  • All contacts who have activities.

Then go to Search > Custom searches > include/exclude search. You include All contacts and exclude the rest.

You can delete contacts from the results screen.

  • While it involves more steps than the other two answers suggested, I think this is the most "correct" answer, short of writing a custom search. Apr 1, 2016 at 5:20

I have not tried this myself because I would then go to the database directly, but have you tried to achieve this with the search builder?


If you use the Summary Fields extension, then you may have some better search options, such as Lifetime donations <1 etc and be able to use them in a single Advanced Search. I think then you would add them to a Group, and then select that Group and search for Activities to try and find those who might have had some level of engagement such that you do want to keep them.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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