Bulk delete WordPress tags and all taxonomy terms

Bulk delete WordPress tags and all taxonomy terms

Be carefull and make database backup before you start.

Delete tags with no posts (but probably with cpt):
especially usefull when you got some tags assigned to custom posts and regular posts as well and need to delete those which not assigned to regular posts

*The same way you can delete tags which are not related to specific cpt. Just replace 'post_type' => 'post' with your custom post type name

Delete empty tags / unused tags:
which means neither post, nor custom posts are assigned to these tags

Bulk delete tags (absolutely all) :

Delete empty taxonomy terms:

*mind to replace $taxonomy_name = 'city'; with your taxonomy’s name

Delete all terms of certain taxonomy: 
whether they got posts or no

You’ve done backup, right?

Добавить комментарий

Ваш e-mail не будет опубликован. Обязательные поля помечены *