Bulk delete all tags which have less than 10 topics assigned to them

I want the Ruby code which I can execute after doing rails c

On my forum, there are lots of tags which have less than 10 topics assigned to them and this is causing lot of thin content and low quality empty pages on my forum and hence google penalizing my forum.

Can someone share with me the code which I can run in console, which can bulk delete all tags which have less than 10 topics assigned to them?

I saw this Delete/Remove All Tags in Bulk but i don’t want to delete ALL tags , just want to delete those which have less than 10 topics assigned to them so that I can get rid of Google thin content penalty of my site.

Also, I have disallowed tags and categories and author pages in my https://howtodiscuss.com/robots.txt, hope it will help me remove Google thin content penalty?

Thanks

1 Like