Skip to content

Instantly share code, notes, and snippets.

@mariusghitulescu
Created September 25, 2019 13:07
Show Gist options
  • Save mariusghitulescu/f3fdcf91fca8604a0e76e4d2d7bf7a6d to your computer and use it in GitHub Desktop.
Save mariusghitulescu/f3fdcf91fca8604a0e76e4d2d7bf7a6d to your computer and use it in GitHub Desktop.
Delete all yst_prominent_words terms
function delete_all_terms(){
$taxonomy_name = 'yst_prominent_words';
$terms = get_terms( array(
'taxonomy' => $taxonomy_name,
'hide_empty' => false
) );
foreach ( $terms as $term ) {
wp_delete_term($term->term_id, $taxonomy_name);
}
}
add_action( 'wp_head', 'delete_all_terms' );
@mariusghitulescu
Copy link
Author

hi where to add this code?

If you know what you are doing, you can add it to your functions.php file. If you want a safer approach, here's how to safely add code snippets in WordPress.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment