Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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
You can’t perform that action at this time.