Sunday, March 18, 2012

purge drupal taxonomy term data


  // drush php-script purge_taxonomy_term.php

  $vocab_vid = taxonomy_vocabulary_machine_name_load("vocab_name")->vid;

  $terms = taxonomy_get_tree($vocab_vid);
  foreach($terms as $term) {
    //$term = taxonomy_term_load($term->tid);
    taxonomy_term_delete($term->tid);
  }

No comments:

Post a Comment