Skip to content

Instantly share code, notes, and snippets.

@alechko
Created June 12, 2013 07:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alechko/5763450 to your computer and use it in GitHub Desktop.
Save alechko/5763450 to your computer and use it in GitHub Desktop.
delete empty taxonomies
$query = db_select('taxonomy_term_data', 't');
$query->fields('t',array('tid'));
$query->condition('name','');
$tids = $query->execute()->fetchCol();
db_delete('taxonomy_term_data')
->condition('tid', $tids,'IN')
->execute();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment