Back to top

Fungus Gnats

Fungus gnat larvae
Fungus Gnat adult fly

Fungus gnat and shore fly adults are a common nuisance in greenhouses, including on vegetable crops, often resulting from overly damp soils with high organic matter. Additionally, fungus gnat larvae feed on plant roots, sometimes causing damage to seedlings directly when populations are very high, or by allowing for pathogens to attack weakened roots. Cultural, biological, and chemical options exist for prevention and management of these pests. 


Photo of fungus gnat larvaFungus gnat adults (Bradysia spp.) are mosquito-like in body shape, about 1/8 inch long, with long legs, a clear pair of wings, and long antennae. They are weak fliers and are frequently observed resting on the media in the pot or running over the foliage or other surfaces. We see them often in spring when gray, cool conditions lead to wet soil as plants are just starting to get going. Their larvae are white and legless, about 1/4-inch long when mature, and have a shiny black head (Figure 1). 

The adult fungus gnat is sometimes confused with another small, dark-bodied fly called the shore fly (Scatella stagnalis). Shore flies have more robust bodies than fungus gnats and their antennae are very short. Their most distinguishing characteristic is the presence of five light-colored spots on each of their dark wings. Shore flies are also stronger, faster fliers than fungus gnats. In the larval stage, shore flies can be distinguished by the opaque, tannish-brown color of the body and the absence of a head capsule. Larvae also have a breathing tube with two dark colored openings called spiracles at the posterior end.


Fungus gnats and shore flies are attracted to damp locations where fungi, a major part of their diet, are apt to flourish. Studies have shown that fungus gnats develop more rapidly and have greater survival on fungal diets. However, in the absence of a fungal food source, fungus gnats can also feed on healthy plant tissue. While adults are primarily a nuisance, larvae feed on plant roots in addition to fungi and decaying organic matter, sometimes tunneling into the crown and stems of plants. This feeding damage creates wounds that allow soilborne pathogens to enter and potentially kill plants. Fungus gnat larvae may also carry some soil-borne pathogens such as Pythium, Thielaviopsis, and Fusarium. Fungus gnats are generalist feeders and can injure a number of greenhouse flower crops as well as vegetable transplants.

Unlike fungus gnats, shore flies are not known to feed on healthy plant tissue in any life stage and are primarily a nuisance. Adult and larval stages of shore flies feed on algae or decaying organic matter and breed in moist environments.

Life CycleDiagram depicting the life cycle of the fungus gnat, which consists of egg, larval, pupal, and adult life stages

Fungus Gnats

The life cycle of fungus gnats is shown in Figure 2. A female fungus gnat may lay up to 300 whitish eggs in clusters of 20 to 30 or more on the surface or in the crevices of moist soil or potting media rich in organic matter. Eggs hatch in about 6 days. Larvae feed for 12-14 days before becoming pupae, which develop inside a silken pupal chamber in the soil. The pupal stage may last 5-6 days, after which adults emerge and live for up to 10 days. The life cycle from egg to adult requires approximately 4 weeks depending on temperature. Development occurs more rapidly with higher temperatures, as is true of most insects.

Shore Flies

Eggs are laid singly on the surface of algae. Pupation occurs at the edge of the algae mats. Breeding takes place in stagnant and strongly saline water found in greenhouses as a result of excessive irrigation and soil leaching. To reduce shore fly numbers, eliminate algae, avoid overwatering, and limit fertilizer run-off. 

Detection and Monitoring

As with any pest, fungus gnat and shore fly control programs are built on prevention and monitoring. To prevent infestations, establish a weekly scouting/monitoring routine for the duration of the crop.

To monitor for larvae, place raw potato chunks with peel removed on the soil surface. Larvae are attracted to the potato chunks, under which they move and congregate. Check the potato chunks daily for larvae. Potato disks that are cut 1 inch in diameter and 1/2 to 1 inch thick work well. Ten potato disks may be sufficient to monitor a 10,000 sq. ft greenhouse. Check disks after 48 hours, counting the number of larvae on each disk and any that are present on the growing medium surface. In addition, choose plants on each bench and inspect the soil surface and the area around the base of the plant including the stem just below the soil line. Record the location and the level of infestation. Badly infested containers of plants should be removed as they serve as a source of infestation.

Adult fungus gnat and shore fly on sticky cardAdult flies can be monitored with yellow sticky cards placed at the base of the plant at soil line. Weekly inspections of yellow sticky cards can detect the onset of an infestation, and continued recording of the number of adults per card per week can aid in evaluating the efficacy of control efforts.

Space 3” x 5” yellow sticky cards at 1-4 per 1,000 sq. ft. throughout the greenhouse. Place yellow cards in a horizontal position just above the soil surface or lay them on the top of the pots. For early detection, position cards near doorways and vents or among new plants being placed in the house. If time permits, check the cards twice weekly, particularly when temperatures warm up in the spring. Research conducted at Cornell University showed that red sticky traps captured more fungus gnat adults than yellow sticky traps. However, yellow sticky traps are commercially available and can be used for a variety of pests in the greenhouse.

Once fungus gnats and/or shore flies begin appearing on sticky cards (Figure 3) or larvae are seen under potato chunks, then it is time to make treatment decisions.


Cultural management strategies are a vital first line of defense for prevention and management of fungus gnats and shore flies. Insect growth regulators, microbials, and other pest control materials applied to the growing medium may be effective in controlling fungus gnat larvae. Most pest control materials do not affect eggs or pupae so repeat applications may be needed.

Cultural management strategies

  • Fungus gnat and shore fly populations may be partially suppressed by sanitation practices that eliminate potential breeding areas. 
  • Keep areas below benches free of spilled potting mix, weeds, and other debris in which fungus gnats and shore flies might breed.
  • Potting media should be pasteurized before use if possible.
  • Moist potting soil high in organic matter that has been left outdoors for long periods may contain fungus gnat larvae. Fungus gnats and shore flies may also be introduced into the greenhouse in the media of infested plants purchased from other greenhouses. Thoroughly inspect all incoming plant material and make early treatments.
  • Eliminate standing pools of water on solid benches, on walks, and under benches. This may be accomplished by proper grading and drainage in the greenhouse and by improving watering practices to prevent runoff.
  • Eliminate algae as best you can. Several algicides are currently registered for algae control in the greenhouse. Disinfectants can be used as part of pre-crop cleanup program and during the cropping cycle for routine algae management. For information on disinfectants, see Cleaning & Sanitizing the Greenhouse in the October 20, 2022 issue of Veg Notes.

Fungus gnat larvae in soil around the crown of a plantIt should be noted that fungus gnat problems are most serious in potting mixes amended with unfinished composts. Microbial activity is excessively high in such mixes, and fungus gnats thrive.

It has also been reported that a pulse in adult emergence follows watering of pots that were previously allowed to dry down. This expected peak in adult fungus gnat populations can be used to time sprays targeting adults or subsequent drenches aimed at larvae.

Prevention and early detection are the keys to controlling this insect, and thus reducing the introduction and spread of disease in the greenhouse.

Biological Control

Several biological control organisms are available for control of fungus gnats including a predaceous mite (Hypoaspis miles), a parasitic nematode (Steinernema feltiae), and a rove beetle (Atheta or Dalotia coriaria).

Bacillus thuringiensis israelensis (bacterium): This soil-borne bacterium may be used before fungus gnat larval populations are high since the bacterium must be ingested to be effective. Applications are more effective on the young larvae (1st instar) than mature (3rd and 4th instars). Bacillus thuringiensis israelensis should be applied until fungus gnat populations start to decline. It is not effective against shore fly larvae. Apply as a drench or in irrigation system according to label directions. It is reported to be toxic to larvae for only 48 hours, so treatments must be repeated. Product name is Gnatrol.

Hypoaspis miles (predatory mite): This predatory mite prefers to feed on young fungus gnat larvae and will also feed on thrips pupae. It may also feed on debris and algae. It is important to make releases early in the growing season before fungus gnat larval populations are abundant. Applications can also be directed to the soil beneath greenhouse benches. Avoid applications into the growing media prior to planting because this decreases survival. Applications need to be initiated after planting and the growing medium should be moist but not saturated. Hypoaspis miles is active when growing medium temperatures are greater than 50°F.

Steinernema feltiae (parasitic nematode): These beneficial nematodes attacks fungus gnat larvae. Nematodes are applied as a drench to containers or flats. They can also be applied through drip irrigation systems, but filters must be removed. Apply nematodes two to three days after inserting cuttings, planting plugs, or starting seeds. To assess the viability of shipments prior to application, place a small quantity of the product in a shallow container with a few drops of tepid water. After a few minutes, look for active nematodes which have a slight ‘J’ curve at the ends of their bodies.

Repeat applications are usually needed. Growing medium temperatures must be 50-80°F, with optimum temperatures of 60-70°F. Irrigate the growing medium before and after applying nematodes. Nematodes are aquatic organisms and require moisture to move throughout the pores of the growing medium. Nematodes should be applied in the evening or on cloudy days as they are extremely sensitive to ultraviolet light desiccation. In general, beneficial nematodes are compatible with most pest control materials except for carbamate and organophosphate pesticides.

Dalotia coriaria, formerly known as Atheta coriaria (rove beetle): This rove beetle is a generalist predator that feeds on fungus gnat and shore fly larvae and reportedly thrips pupae in the growing medium. Adults are slender, dark brown to black, and covered with hairs. The adults are 1/8 inch long with very short wing covers. They fly throughout the greenhouse from original release sites. Larvae are cream to brown in color, depending on age. Both stages inhabit cracks and crevices in the growing medium. Once established in a greenhouse, rove beetles may be present year-round, although populations may fluctuate depending on fungus gnat populations. Because they are generalist feeders, they may consume many other natural enemies including H. miles. In addition, young rove beetle larvae may be fed upon by soil-dwelling predatory mites. However, rove beetles are compatible with beneficial nematodes. These beetles are commercially available as adults from most biological control suppliers. Optimum temperatures are 65-80°F and relative humidity of 50-85%. Both adults and larvae are difficult to detect by scouting since they tend to hide in the cracks and crevices of growing medium. 

D. coriaria actively search for prey, primarily targeting eggs, young larvae, and pupae. Because they can fly, adults can travel through a greenhouse, aiding distribution and population development. 

Coenosia attenuata (hunter flies): Hunter flies are small flies which closely resemble common house flies. Adult hunter flies attack and feed on flying prey including fungus gnat, shore fly, whitefly, and leafminer adults. They are introduced either on new plant material or by flying into unsprayed greenhouses during the growing season. Yellow sticky cards may trap hunter fly adults. The soil-dwelling larvae are also predaceous and feed on fungus gnat larvae and other insects in the growing medium.

Synacra pauperi (parasitoid wasp): Females of this species insert eggs into fungus gnat larvae, which then hatch and feed on the fungus gnat larvae. Parasitized fungus gnat larvae live until pupation, after which an adult Synacra paupera emerges. This parasitic wasp may also be captured on sticky cards, especially in unsprayed greenhouses, and may resemble a fungus gnat at first glance. However, these wasps have a notable constriction between their thorax and abdomen and long beaded, elbowed antennae. Their maximum rate of increase is higher than fungus gnat larvae at 73°F.

Most biological control options used for fungus gnat control do not appear to work as well against shore flies because of the semi-aquatic environment in which they live. Beneficial nematodes (S. carpocapsae) will infect shore fly larvae but may not offer sufficient levels of control in commercial greenhouses. In unsprayed greenhouses, a tiny parasitoid of shore flies, Hexacola neoscatellae, occurs naturally in greenhouse and may slow the growth rate of shore fly populations. The rove beetle Dalotia coriaria may be an option for biological control of shore flies, but will not work on larvae that are in standing water. 

Pesticide Treatments

If insecticides are used for treatment, soil treatments directed toward the larval stage at the first sign of insect activity are best to manage fungus gnats. Make sure material is applied to a depth of 1” or more. Materials are most effective when they are retained in the media. Keep this in mind when fertilizers, fungicides, and water all need to be applied to plants. For example, if a fungicide and an insecticide is necessary, apply the fungicide first, then water it in with the insecticide. The fungicide will be moved into the root zone where it is needed and the insecticide will stay in the top where it is needed. Some insecticides are labeled for use on greenhouse floors and under benches in addition to treatments to pots. Insecticides may not affect eggs or pupae, and repeated applications may be necessary. Carefully read and follow all label directions.

For a list of pesticides and more information on using biological control to manage fungus gnats see the current issue of the New England Vegetable Management Guide.

Further Reading

Crops that are affected by this insect:


-- Written by Tina Smith, UMass Extension Greenhouse Crops and Floriculture Program Emeritus. Revised by Alireza Shokoohi, 2024. 

    Last Updated: 
    March 2024

    The Center for Agriculture, Food and the Environment and UMass Extension are equal opportunity providers and employers, United States Department of Agriculture cooperating. Contact your local Extension office for information on disability accommodations. Contact the State Center Director’s Office if you have concerns related to discrimination, 413-545-4800 or see