How to programmatically delete taxonomies when a module is uninstalled? Taxonomy vocabularies are in the CMI as of Drupal 8, but I want to also keep the Taxonomy terms in code. I am programmatically creating terms in a custom module. 

function taxonomy_vocab_install() {
  foreach (taxonomy_term_info() as $term_info) {
    $term = Term::create(array(
      'parent' =&gt; array(),
      'name' =&gt; $term_info['name'],
      'description' =&gt; [
        'value' =&gt; $term_info['description'],
        'format' =&gt; 'full_html',
      ],
        'vid' =&gt; 'department',
    ));
    $term-&gt;save();
  };
};


Now, I want to delete the terms on uninstall, but taxonomy_term_delete is depreciated. Any help on how to programmatically delete the created taxonomy terms in D8 when the module is uninstalled would be greatly appreciated.

function taxonomy_department_uninstall() {
  // ?? 
};
I did not test it myself, but as far as I see in the documentation, Term is using Entity::delete(). You might try to load the terms you wish to delete and call this method directly on them:

$term-&gt;delete();