Planaria is caused by uneaten food and other dirty things in the tank. Make sure you remove uneaten food from the tank within 20 minutes of feeding time, and of course spot clean as soon as you see messes.
You can also do daily 20% water changes to make sure the water quality is/stays pristine. This will also help because you'll be removing the planaria (especially if you aim for them!).
If you're still having issues, I'd suggest a deep-clean of the tank. Drain all the water, scrub the tank and all décor down with hot water and let air dry. Be aware that this will crash your cycle, but unless any are hiding on your axie, it should get rid of them!
Best of luck!