Aug 01, 2019 in Drupal 8, Snippets
$vid = 'MY_VOCABULARY_ID';

$tids = Drupal::entityQuery('taxonomy_term')
  ->condition('vid', $vid)
  ->execute();

if (empty($tids)) { return; }

$package = \Drupal::entityManager()
  ->getStorage('taxonomy_term');
$terms = $package->loadMultiple($tids);

$package->delete($terms);