Skip to content

Instantly share code, notes, and snippets.

@jonathanfranks
Last active August 29, 2015 14:14
Show Gist options
  • Save jonathanfranks/e842209c89677a1b28e1 to your computer and use it in GitHub Desktop.
Save jonathanfranks/e842209c89677a1b28e1 to your computer and use it in GitHub Desktop.
Delete all terms from a vocabulary
$vocab_name = '';
$vocab_id = taxonomy_vocabulary_machine_name_load($vocab_name)->vid;
dpm($vocab_id);
$tids = array();
foreach (taxonomy_get_tree($vocab_id) as $term) {
taxonomy_term_delete($term->tid);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment