Fungus gnats are small, non-biting insects that take up residence in the top 2 or 3 inches of your houseplant's potting medium, laying eggs and feeding on the fungi and organic matter in the soil. They can, if left unchecked, damage plant roots and stunt the growth of your houseplants. Fungus gnats can establish a presence on houseplants that are summered outdoors and brought inside in the fall or they can spread from a newly acquired plant. Control is not difficult.
Take the potato test. Cut a quarter-inch slice of raw potato and insert it into the soil. Fungus gnats will nibble the potato and it will show significant damage in two to three days. Look for small, translucent larvae on the slice.
Let the soil dry out. Adult fungus gnats prefer damp soil conditions for egg laying. In addition, dry soil is less prone to fungi growth, the primary food of gnats. Dry conditions will kill some of the existing gnat larvae as well. Overwatering is the most common cause of houseplant death, so allowing the top 1 to 2 inches of soil dry out between waterings benefits your plant in several different ways.
Supply good drainage. Replace compacted potting soil with a fresh, well-drained mix. Do not allow water to stand in the collection tray beneath your plant.
Use 3-inch by 5-inch, yellow sticky traps to capture egg-laying adults. These non-toxic, adhesive-based traps attract and kill many---but not all---adult gnats.
Drench the soil with a microbial insecticide. Bacillus thuringiensis (commonly known as Bt) is a microscopic bacterium that kills gnat larvae. Bt is harmless to people, pets, plants and fish.
Put nematodes to work. Steinernema feltiae nematodes thrive in moist conditions between 60 and 90 degrees Fahrenheit. Applied as a soil drench, they will, according to the University of California, "reproduce and actively search for hosts, so under moist conditions they may provide season-long control after several initial applications to establish populations."