How can I delete a poorly named vocabulary? I've created a couple of vocabularies programmatically, and accidentally included some spaces in the machine names (caused by bad data in an input CSV). I can't delete these vocabularies with Vocabulary::load($vid)-&gt;delete();, even though I can see the vocabularies names with
dsm(taxonomy_vocabulary_get_names());, while load($vid) returns NULL.
Any ideas on how I can delete these vocabularies? I was able to delete all the terms in a vocabulary, but the reference remains under admin/structure/taxonomy.
Where are you calling that code? Is the $vid really right? You say it has spaces in it? Did you try to delete them from the UI?
Under /admin/structure/taxonomies where you have all vocabularies listed, open the operations dropdown and click &quot;Edit vocabulary&quot;.

On the next page click &quot;Delete&quot;.