Fungus gnats are a nuisance in their adult form as they swarm around plants, but the real damage is done in the larval form. Gnat larvae eat plant roots and burrow into stems. They cause pathogen infection not only as carriers, but also by weakening plant surfaces and allowing entry. Diatomaceous earth is an all-natural product that can be used to kill gnats in both larval and adult forms.
Amend the soil with diatomaceous earth. Diatomaceous earth is a mineral powder made from fossilized water plants. Diatomaceous earth affects gnats by stripping or absorbing the waxes and oils from the insects' body. When it is blended with the soil, diatomaceous earth comes in contact with larvae and destroys them. Study remains necessary to determine how effective this method actually is. It appears to be least effective in greenhouse plants.
Sprinkle diatomaceous earth on the soil surface. Ideally, diatomaceous earth works best when it prevents gnats from laying eggs and allowing larvae to hatch. The layer of diatomaceous earth creates a barrier between the gnat and the soil. When the adult gnat becomes exposed to the diatomaceous earth, its exoskeleton is shredded.
Spray a solution of diatomaceous earth over plants and soil. This method has the potential of dispersing the diatomaceous earth most evenly, and may even affect gnats in flight. Repeated application is required.
Create a slurry of diatomaceous earth and water. To treat large areas plagued with gnats, paint the surroundings with this slurry. For example, you can use this method to fill cracks in pavement or garden walls. You can also use it to coat the bases of tree trunks or sturdier plant stems.