I recently set about consolidating the tags I use on my blog posts to make the category listing and tag cloud smaller and more user friendly. In addition reducing the the number of tags and making them more generic means the remaining pages will contain more content and should rank better on the search engines.
Having completed the cleanup in the umbraco client I then turned my attention to the database to see what old tag information remained.
The following SQL Command will show you the unused tags in your database.
select * from cmstags where id not in (select tagid from cmsTagRelationship)
select * from cmstags where id not in (select tagid from cmsTagRelationship)
To delete these unused tags simply run:
delete from cmstags where id not in (select tagid from cmsTagRelationship)
If you would like to remove a tag that is still associated with one or more posts simply run:
delete from cmsTagRelationship where tagId in (select id from cmsTags where tag = 'OLDTAG')
which will delete the relationship and then:
delete from cmsTags where tag = 'OLDTAG'
Which will remove the tag itself.
@ismailmayat has also created an umbraco package for tag management that can be found at http://our.umbraco.org/projects/tagmanager.














