If you have been using WordPress for quite some time, no doubt that you have built up quite a collection of tags and categories. If you’ve ever wanted to clean a little house with your tags, you can do it quick and easy if given access to your MySQL command line interface. The following command will remove all tags that have a post count of “0″ (meaning no posts are using these tags).
DELETE t.*, tx.* FROM wp_terms t, wp_term_taxonomy tx WHERE t.term_id = tx.term_id AND tx.taxonomy = "post_tag" AND tx.count = "0";
Want to remove any tags that are only being used in 1 post or less? Simple, use the following:
DELETE t.*, tx.* FROM wp_terms t, wp_term_taxonomy tx WHERE t.term_id = tx.term_id AND tx.taxonomy = "post_tag" AND tx.count < "2";
Now go to your Post Tags management screen and look on in amazement as you now have a manageable number of tags. Keep in mind that this is irreversible, once you run this query...those tags are long gone and will have to be recreated.

{ 0 comments… add one now }
{ 3 trackbacks }