How to Get Rid of Soldier Flies and Their Larvae

The Black Soldier Fly (Hermetia illucens) is the species most commonly encountered in residential areas. While these insects are beneficial decomposers whose larvae rapidly consume organic waste, large populations near homes, especially in outdoor waste containers or compost systems, become a significant nuisance. Removing an infestation requires a two-pronged approach: eliminating the damp, rich organic material where the larvae thrive and managing the remaining adult flies and larvae.

Identifying Soldier Flies and Locating the Breeding Source

Identifying the Black Soldier Fly (BSF) adult helps distinguish it from common houseflies or wasps. Adult BSF are large, growing up to five-eighths of an inch long, with a dark, elongated body often mistaken for a wasp. A distinguishing feature is two translucent, “window-like” spots on the first abdominal segment. They are slow flyers, often appearing to drift, and do not sting or bite.

The larvae are the most obvious sign of an infestation, and locating their concentration point is the primary step toward removal. BSF larvae are pale, segmented, and tough-skinned, reaching over an inch in length as they mature. They require warm, wet, and decomposing organic matter to develop. Inspect poorly managed compost piles, garbage bins that are not tightly sealed, accumulations of pet waste, and drainage systems where organic sludge has collected. Larvae will be visible in masses, feeding voraciously on the nitrogen-rich material.

Sanitation and Source Elimination Strategies

Permanent removal depends on making the breeding environment inhospitable, which is superior to chemical treatment. Larvae thrive in wet conditions with abundant food, so sanitation must eliminate these two factors. In compost bins, ensure a proper balance of “greens” (nitrogen) and “browns” (carbon) to absorb excess moisture and reduce odors that attract egg-laying females.

When adding kitchen scraps, bury the nitrogen-rich material well beneath the surface, covering it with two to four inches of dry, carbon-heavy material like shredded paper or dry leaves. Turning the compost frequently helps dry out and aerate the pile, elevating the internal temperature. BSF larvae cannot survive above 113°F (45°C), so a hot, actively decomposing pile naturally deters them.

Outside of composting, strict control over household waste prevents re-infestation. All outdoor garbage containers must have tightly fitting lids and should be cleaned regularly to remove organic residue or leachate. Promptly removing pet waste and addressing areas of standing water or damp soil near structures eliminates secondary breeding sites, preventing the flies from completing their life cycle.

Direct Control and Exclusion Techniques

While sanitation addresses the root cause, immediate measures are needed to manage the current population of larvae and adult flies. Exclusion is the first line of defense for structures, as adult soldier flies may enter buildings searching for new places to lay eggs. Ensure all windows, doors, and vents are sealed, and outdoor storage areas housing organic material are covered with fine-mesh screening to block adult access.

For larvae still present in a breeding site, physical and non-toxic treatments can be applied. Sprinkling food-grade diatomaceous earth (DE) over the infested material controls larvae populations. This fine, abrasive powder lacerates the insect’s exoskeleton, leading to dehydration and death. DE is safe for worms, making it a viable option for use in vermicomposting systems where BSF larvae are outcompeting the worms.

When dealing with heavily infested, non-essential waste areas like the bottom of a garbage bin, localized heat treatment is a quick solution. Pouring boiling water over the concentrated mass of larvae kills them instantly. For adult flies, localized trapping methods using a simple fermenting bait can capture them, though this is less effective than source elimination. A container with overripe, mashed fruit or a 50/50 mix of bran and water, allowed to ferment, attracts the adults.