@@ -6312,6 +6312,11 @@ See reference for [taxonomies and their terms](https://wordpress.org/documentati
63126312 Success: Updated category term count
63136313 Success: Updated post_tag term count
63146314
6315+ # Prune terms with 0 or 1 published posts
6316+ $ wp term prune post_tag
6317+ Deleted post_tag 15.
6318+ Success: Pruned 1 of 5 terms.
6319+
63156320
63166321
63176322### wp term create
@@ -6927,6 +6932,47 @@ to bring the count back to the correct value.
69276932
69286933
69296934
6935+ ### wp term prune
6936+
6937+ Removes terms with 0 or 1 published posts from one or more taxonomies.
6938+
6939+ ~~~
6940+ wp term prune <taxonomy>... [--dry-run]
6941+ ~~~
6942+
6943+ Useful for cleaning up large sites with many unused or barely-used terms.
6944+ The term count is based on the number of published posts assigned to each
6945+ term.
6946+
6947+ ** OPTIONS**
6948+
6949+ <taxonomy>...
6950+ One or more taxonomies to prune.
6951+
6952+ [--dry-run]
6953+ Preview the terms to be pruned, without actually deleting them.
6954+
6955+ ** EXAMPLES**
6956+
6957+ # Prune post tags with 0 or 1 published posts.
6958+ $ wp term prune post_tag
6959+ Deleted post_tag 15.
6960+ Success: Pruned 1 of 5 terms.
6961+
6962+ # Dry run to preview which terms would be pruned.
6963+ $ wp term prune post_tag --dry-run
6964+ Would delete post_tag 15.
6965+ Success: 1 post_tag term would be pruned.
6966+
6967+ # Prune multiple taxonomies at once.
6968+ $ wp term prune category post_tag
6969+ Deleted category 8.
6970+ Success: Pruned 1 of 3 terms.
6971+ Deleted post_tag 15.
6972+ Success: Pruned 1 of 5 terms.
6973+
6974+
6975+
69306976### wp term update
69316977
69326978Updates an existing term.
0 commit comments