I deleted some posts from one of my blog and then i saw that tags i used in those posts were still there so searched internet to mass delete those tags as they were in thousands and found this fix

Run this in your phpMyadmin or anywhere you can execute sql

DELETE FROM wp_terms WHERE term_id IN (SELECT term_id FROM wp_term_taxonomy WHERE count = 0 );

This will effectively remove them from everywhere the admin can see but they still exist in the relationship table

to remove them from relationship tabel run this quary

DELETE FROM wp_term_relationships WHERE term_taxonomy_id not IN (SELECT term_taxonomy_id FROM wp_term_taxonomy);

Remember you need to change the ‘wp_’ to your prefix.