DB Cleanup (Deleted tag history

Hi All,

Is there a built-in/elegant way to delete tag history for tags that no longer exist?
The only way I know of is by manually finding the tagid's in sqlth_te and deleting rows from sqlt_data_xxxxx