Gnats, those tiny, pesky flying insects sometimes found indoors, can be a bit of a nuisance in numbers. These creatures are often found around houseplants, where their larvae grow within potting materials. While they only live a short time -- just over a week -- a female fungus gnat can lay up to 200 eggs in the potting mix, which can result in an onslaught of gnats if left alone. Altering the conditions gnats find attractive, as well as killing them with a homemade solution, can greatly reduce their presence.

Soap Spray for Leaves

Treat leaves of a gnat-infested plant with a homemade insecticidal soap. Make the blend yourself by pouring 2 tablespoons each of liquid castile soap and a vegetable oil such as olive oil, plus a teaspoon of powdered cayenne pepper, into a gallon container with a gallon of water. Seal and shake the bottle, then transfer some of the mixture to a spray bottle. Spraying the tops and bottoms of plant leaves both kills and helps prevent additional gnats. Applying the mixture every several days for a few weeks may be necessary to get rid of all the gnats.

Bacillus Thuringiensis

Bacillus thuringiensis, also known as Bt, is a microbial insecticide that occurs naturally in soil. It kills fungus gnats by producing a protein that causes a toxic reaction in the insect guts, ultimately resulting in the gnat's starvation. While harmful to gnats, Bt is harmless to people, plants and pets. Apply it as a liquid spray watered over the plant approximately once a week. It may take several days to notice its effects.

Nematodes

Beneficial nematodes are tiny round worms found in some soils. These creatures enter gnat bodies and multiply within them, releasing a bacteria that kills the gnat or gnat larvae. Commercial products containing nematodes are designed for treating the soil where the gnats thrive. Apply nematodes to the affected soil with water through a sprayer at dusk, dawn or on a cloudy day, as these tiny creatures are sensitive to ultraviolet light. Water the soil before and after applying nematodes, as they need the water to thrive.

Preventive Maintenance

Fungus gnats are attracted to moist soil. Overwatering a houseplant results in soil that stays continually moist in the first couple of inches. Water plants less often -- wait until the top several inches of soil are dry before watering. Remove standing water from house plant trays, or in areas around gnat-infested areas outdoors, to help cut back on the gnat population. Adding a little sand to the top layer of soil around houseplants also helps keep the top of the soil dry, making it less attractive to gnats. As potting soil becomes old, it retains too much moisture, so re-pot those plants sitting in an older potting mix, discarding the old potting soil in a sealed bag.

Trapping