Skip to content

Instantly share code, notes, and snippets.

@aramboyajyan
Created July 20, 2016 07:47
Show Gist options
  • Save aramboyajyan/6e75cf30c75f30ec79e088b226aa4d3b to your computer and use it in GitHub Desktop.
Save aramboyajyan/6e75cf30c75f30ec79e088b226aa4d3b to your computer and use it in GitHub Desktop.
Drupal 7 delete all terms from a vocabulary programmatically
$results = db_query("SELECT tid FROM {taxonomy_term_data} WHERE vid = :vid", array(':vid' => PLACE_HERE_VOCABULARY_ID))->fetchAll();
foreach ($results as $result) {
taxonomy_term_delete($result->tid);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment