Remove organic mulch, wet potting soil and other rotting debris from around the ponytail palm, taking care not to disturb its roots. Prune dead or dying leaf fronds with pruning shears. Disinfect your pruning shears before and after use by soaking them in a solution of 1 part household bleach and 3 parts water for five minutes. Leave them to air dry.
Water the ponytail palm when the soil is dry to a depth of 2 inches. Drain an indoor palm thoroughly before replacing its drain tray.
Cut yellow sticky traps in half with scissors and attach each square to a skewer by pushing the skewer in at the top of the card and out at the bottom. Push the skewers into the soil around a ponytail palm in a container to catch adult fruit flies and fungus gnats. Alternatively, hang traps from the leaves of an outdoor ponytail palm. Replace traps when they are covered in insects, dust or debris.
Peel a potato and cut it into chunks. Push the chunks just under the soil around the ponytail palm roots. Fungus gnat larvae are attracted to raw potato. Remove the chunks after three or four days and replace them with fresh ones. Dispose of infested chunks.
Water the ponytail palm with a solution containing diatomaceous earth, diluted at a rate of 4 tablespoons to 1 gallon of water or according to the manufacturer's instructions. Reapply as needed.
Drench the soil surface around the ponytail palm with a biological insecticide that controls fungus gnats, such as Bacillus thuringiensis israelensis, diluted at a rate of 1 to 2 teaspoons per gallon or according to the manufacturer's instructions. Apply Bti three times a week for heavy infestations or weekly for regular control.