Created
September 25, 2019 13:07
-
-
Save mariusghitulescu/f3fdcf91fca8604a0e76e4d2d7bf7a6d to your computer and use it in GitHub Desktop.
Delete all yst_prominent_words terms
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.