I also have the same problem in my tank and i found some directions I plan on trying. I just thought I forward this to you. Maybe it will become useful. Also thanks to Phantom Theif guy.
Planaria are often found in aquariums with uneaten food. The planaria won't hurt the fish, but they are a symptom of too much gravel containing too much uneaten food, and that is not good for fish.
recommendations.
1. Clean your aquarium gravel with a Gravel Washer.
2. Add Aquarium Salt to your aquarium up to a maximum of 1 Tablespoon for each 5 gallons of water in your aquarium.
3. Clean your gravel every day with the Gravel Washer. When you've removed 20% of the water, stop and top your aquarium back up with tap water ( I would treat the water or let it sit to remove the chlorine, it were me). Repeat this procedure every day.
4. It may take several days of gravel washing to get your gravel really clean. When it is finally really clean, begin removing gravel, until it is at most 1/4" deep.
5. Add Quick Cure after you clean your aquarium and wash the gravel, treat the water with 1 drop of Quick Cure for each gallon of water in your aquarium. Keep in mind You can also replace the Aquarium Salt that you removed, which would be 1 Tablespoon in the 5 gallons of water.
6. Small fish such as baby mollies might eat the planaria. I would try adding a few small fish to see if they will eat the planaria.
Repeat steps 1 to 6 listed above, until you don't see the worms any more. This procedure will take several days and require quite a bit of your elbow-grease, but it's the safest method for the rest of the fish in your aquarium.