Skip to content

Instantly share code, notes, and snippets.

@sabrina-zeidan
Last active July 22, 2017 15:01
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 sabrina-zeidan/6ab7dd60f935c92b59b0f0995602f82e to your computer and use it in GitHub Desktop.
Save sabrina-zeidan/6ab7dd60f935c92b59b0f0995602f82e to your computer and use it in GitHub Desktop.
Bulk delete all tags [Wordpress]
function delete_all_tags(){
$tags = get_tags( array('number' => 0,'hide_empty' => false));
foreach ( $tags as $tag ) {
wp_delete_term( $tag->term_id, 'post_tag' );
}
}
add_action( 'wp_head', 'delete_all_tags' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment