If a swarm of tiny black flies buzzes around your houseplants every time you walk by, you've got fungus gnats. As larvae, fungus gnats survive on the fungus and algae that grows on consistently moist potting soil. They may also feed on the tender roots of your house plants, leaving them more susceptible to disease. The adults do not feed, but they may spread root disease as they move from plant to plant. To get rid of a heavy infestation of fungus gnats, you may need to apply several control methods.
Allow the top few inches of the soil to dry out between each watering. This is not only healthier for most plants, but it deprives the fungus gnats of the soil moisture that they need to survive.
Prune away and discard any dead or decaying plant material on or around your plant.
Treat your houseplant's soil with a persistent insecticide labeled for use on fungus gnats according to the manufacturer's instructions. Resident entomologists at Colorado State University recommend pyrethroid-based insecticides that contain the active ingredients bifenthrin, cyfluthrin, permethrin or lambdacyhalothrin. Re-treat the soil as needed at the intervals dictated by the manufacturer.
Place yellow sticky traps (available at most home and garden centers) around the edge of your house plant's container.