Black soldier fly larvae in compost: keep them or get rid of them?
Black soldier fly larvae won't harm you or the compost, Oregon State says. Keep them, or bury scraps under 2–4 inches of dry material to get fewer.

Say you lift the lid and the top of the bin is moving: fat, segmented larvae, and the peelings you added yesterday are already half gone. Oregon State University Extension says the “maggots” people find in compost bins are often black soldier fly larvae, and that they help break scraps down. Whether you keep them is up to you. If you’re not sure which kind of maggot you have, check the next section or maggots in the compost bin.
Quick fix
- Happy to keep them? Do nothing. UF/IFAS Walton County says “There should be no need to encourage them beyond adding material for them to eat, such as vegetable scraps, from time to time.”
- Want fewer? Bury new scraps under dry browns, and turn the pile if the larvae crowd the bin. Oregon State’s steps are below.
- Digging in? Our advice: wear gloves, and wash your hands afterward.
Soldier fly larvae or housefly maggots?
Oregon State describes young soldier fly larvae as “gray-white, segmented, about 1 inch long and very active,” turning dark brown and flattened as they mature. The adult looks like a wasp: UF/IFAS’s species profile calls it “black or blue in color,” with two translucent “windows” on the first segment of its abdomen. For housefly maggots and how to tell the two apart, see maggots in the compost bin.
Are black soldier fly larvae good for compost?
They eat food scraps fast. In Oregon State’s words, they “accelerate decomposition and inoculate compost with beneficial bacteria and fungi” and “help break down plant and animal tissues.” The larvae “can eat more than their own body weight every day,” per UF/IFAS Walton County, and “leave rich, useful compost behind.”
Eating animal tissue doesn’t make the larvae a reason to put meat in a regular bin. Keep meat, fish and dairy out, as what not to add explains.
Are black soldier fly larvae dangerous?
Oregon State says the larvae “won’t harm you or the compost,” and that the adults, “often mistaken for black wasps,” “don’t bite or carry disease.” UF/IFAS Walton County agrees that the adults have no stinger and “are harmless to humans.”
UF/IFAS’s species profile (Featured Creatures, EDIS IN830) agrees: “Although the loud buzzing they create when flying is enough to concern many people, adult soldier flies pose no danger.” It adds a caveat, though: “Although they are not known as a disease vector, adult soldier flies are a potential mechanical vector of various pathogens.” That means they could carry germs on their bodies. On the larvae, it says: “A more likely negative interaction would be accidental ingestion of black soldier fly larvae by animals or humans.” Our advice stays the same: gloves, then hand-washing.
Why soldier fly larvae are in your compost bin
A wet, food-rich bin suits them. Oregon State says soldier flies “are especially common where flies have access to wet, rotting food or garbage,” and that “Female flies lay eggs on exposed nitrogen-rich material.” Where natural habitats are removed, the fly “will lay eggs in dumpsters or compost,” according to UF/IFAS’s species profile.
Where you live and the time of year matter too. “In the southeastern United States, the black soldier fly is abundant during late spring and early fall,” the same profile says. Purdue Extension Entomology calls it “commonly found throughout the southern portions of the US,” and Oregon State, “now widespread across North America.”
Keeping them
Beyond adding scraps, the rest is optional:
- Share them with the birds, if you like. With gloves on, pick out a handful. Oregon State says the larvae “can be removed from compost piles and offered to chickens or left on the ground for wild birds to find.” The UF/IFAS species profile, above, names accidental ingestion “by animals or humans” as a more likely negative interaction, but it doesn’t say whether feeding larvae to chickens is safe or unsafe.
- Expect a few wanderers. Full-grown larvae leave their food to pupate and “find a nice, dry sheltered area,” per UF/IFAS Walton County. Soldier flies are “rarely found indoors,” Oregon State says, unless a compost pile is close to a house.
- Keep the moisture right. Our test: squeeze a handful from a few inches down. It should feel like a wrung-out sponge. If it drips, mix in browns until it doesn’t; compost too wet has the full method.
For a bin kept for the larvae that gets too wet, Purdue’s guide says: “The larvae can survive this moist environment, but the decomposition will be slowed and your bin will begin to smell as a result of microbial decomposition.” Its fix is to “drain the water off and dry them out by either leaving the lid off or adding more brown material like shredded cardboard, old bread or flour/grains.”
How to get rid of black soldier fly larvae in compost
The aim is to give the flies less to work with. Oregon State’s advice for discouraging them is to cover food scraps with carbon-rich “brown” material, such as leaves, dry grass or shredded paper, and to “Bury kitchen waste well in the compost pile and cover it with 2 to 4 inches of dry, absorbent material.” That’s 5–10 cm.
If larvae become abundant, Oregon State gives three steps:
- “Turn the compost and mix in dry material.” Our tip: use a garden fork, such as the Truper 4-tine spading forkad, to turn an open pile, or to work dry browns down through the lid of a closed bin.
- “Allow the pile to heat up — soldier fly larvae can’t survive above 113°F.” That’s 45°C. To see whether your pile gets that warm, push a long-stem compost thermometer, such as this 20-inch compost thermometerad, into the middle. Our note: small home bins often stay cold and still make compost; compost not heating up covers how to warm a pile, and why you don’t have to.
- “Cover holes in compost bins with window screen attached using waterproof caulk to exclude egg-laying adults.”
Two more steps of our own: keep the lid on, and go easy on very wet scraps.
Sprays aren’t the fix. Writing about soldier flies in and around houses, Mississippi State University Extension says “Insecticides are rarely useful for soldier fly control.” In a compost bin, the covering, screening and turning above are the fix.
Black soldier fly compost bins
Some people raise these larvae on purpose, in a bin built for them. Purdue’s guide has plans for 18- and 55-gallon rearing bins. In both, ramps let the mature larvae crawl out when they’re ready to pupate, so you can collect them.
Purdue calls black soldier fly composting “a bit different from standard composting.” Its larvae bin can take “more processed materials and animal products”; in a regular pile, keep them out. To stock one, Purdue, writing from Indiana, suggests “purchasing BSF larvae early in the spring to initially stock your bin because they do not successfully overwinter.”
If that didn’t work
- Still soggy after the browns? Work through compost too wet.
- Larvae everywhere, even with scraps buried? Look again at why they come. Our advice: check that nothing wet and food-rich is left uncovered or slipping in, starting with what not to add.
- Pile won’t warm up? See compost not heating up.
- Other creatures in the bin? Try bugs in the compost bin, rats and flies or ants in the compost bin.