I have a 5000+ entries for custom Entities created by the RedHen module (https://drupal.org/project/redhen). I want to wipe them completely from the system (they are all test entries). How can I do this quickly? I tried to get Views Bulk Operations and the Delete All modules but neither seem to be picking up the custom entities.

2 Answers 2


You can delete multiple entities using below API functions


Load entities from the database.

The entities are stored in a static memory cache, and will not require database access if loaded again during the same page request.

$entity_type: The entity type to load, e.g. node or user.

$ids: An array of entity IDs, or FALSE to load all entities.


Permanently delete multiple entities.

For Example to delete all node entities

  $results = entity_load('node');
  $entity_ids = array_keys($results);
  entity_delete_multiple('node', $entity_ids);
  • Yes this looks right, but I'm confused on proper usages of this. Ideally i just want to run this once or twice. Would I add this to my custom module and have it hook and run with update.php?
    – jhoffmcd
    Commented Mar 8, 2014 at 0:12
  • How many Entity Types do you have ?
    – Anil Sagar
    Commented Mar 8, 2014 at 2:30
  • Actually I was able to put this in a preprocess function on a specific page I created and it worked! I had to separate it out in chunks though, I had over 100,000 entities in the DB. So it worked! Thank You.
    – jhoffmcd
    Commented Mar 9, 2014 at 4:30

This simple module might help you: https://www.drupal.org/project/entity_bulk_delete

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.