I have a need to remove all nodes of the same type in Drupal 8 (there are over 7k of nodes).
It wouldn\'t be a problem for Drupal 7 (DB query + node_del
To delete all entities of some entity types, i use this snippet adapted from last comment:
$entity_types = ['taxonomy_term','node','menu_link_content',];
foreach ($entity_types as $entity_type) {
$query = \Drupal::entityQuery($entity_type);
$ids = $query->execute();
$storage_handler = \Drupal::entityTypeManager()->getStorage($entity_type);
$entities = $storage_handler->loadMultiple($ids);
$storage_handler->delete($entities);
}