Quantcast
Channel: Beyond web Logs
Viewing all articles
Browse latest Browse all 90

WordPress delete unused tags using SQL Query

$
0
0

While working on website usually we create tags with post and sometime delete posts but not tags, and after few years you will get a large database of unused tags. To delete them form admin area is a hard work or you will assign this task to any person on any freelance website like Odesk.com but its really easy to delete them from SQL, just get backup of your database before running this query.

It’s tested and it’s safe.

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

 


Viewing all articles
Browse latest Browse all 90

Trending Articles