if its a huge planaria explosion then your doing something wrong and you need to figure it out. they are a symptom.
its usually overfeeding but poor filter maintenance can also be a cause as can poor tank husbandry. basically anything that lets uneaten food sit for long periods.#
you cant be totally free of planaria, its just that you generally dont see them because the population is usually hidden in gravel, the filter, decor, etc. but when there is too much food in the tank, the population explodes and they end up all over everything and very noticable.
normally the small population works behinds the scenes eating tiny particles of food as part of the eco-system you have set up.
vac the gravel, reduce the food amount per sitting and rinse half your filter media in old tank water. you should notice a difference in a couple of days as planaria populations rise and fall very quickly.