getStorage('node'); // Query all entity. $query = $queryFactory->get('node') // <-- replace event in below line with your content type machine name ->condition('type', 'photograpy'); $nids = $query->execute(); // Delete entities. if (!empty($nids)) { $entities = $nodeStorage->loadMultiple($nids); $nodeStorage->delete($entities); } }