Do Not Allow Even One Fruit Fly Into Your Kitchen Compost

Collecting food scraps in your kitchen can invite insect invaders. But there are plenty of ways to outsmart them.

Four very brown bananas laid on their side on a wood surface
Vadym Plysiuk / Getty

Last week, as my spouse and I were settling into our new home, we were dismayed to find a small cavalry of uninvited visitors in our kitchen. They raided the pantry and the fridge; they snuck into our bathroom. Every evening, we tried to shoo these invaders out the door, to no avail: The container of food scraps on our counter, waiting to be picked up by our local composting company, made the allure of our abode too strong for these fruit flies to resist.

My household had been through this particular saga before, and I’ve generally grimaced my way through it. In the U.S., food waste is responsible for nearly 3 percent of the country’s emissions, according to the EPA—and that’s before considering the methane that leaks from landfills, where food waste is the single largest category of material that gets dumped. Diverting even some of that waste is a win for everyone involved, and more cities across the U.S. are at least trying to persuade people to separate their scraps from their trash. I, like many others, just wish that the whole business could be a bit less … friendly to the flies.

Decomposing food into nutrient-rich soil is, at its heart, a delightful exercise—a form of rot, yes, but one in which we recruit a menagerie of insects, arachnids, and microbes to feast on our leftovers and turn them into something useful to us. I don’t expect that process to be mess-free. But the goal should be for the bulk of the action to happen outside the home. Even food scraps saved up in the kitchen don’t have to create so much slime or attract that many winged pests. “I’ve been doing this for 30 years, and I’ve had no fruit flies,” Rhonda Sherman, a composting expert at North Carolina State University, told me.

To be fair to the flies, a countertop pile of bones, shells, stems, peels, seeds, and cores does make for a pretty tantalizing buffet that fruit flies, house flies, and soldier flies can potentially detect from hundreds, if not thousands, of feet away. “Their sense of smell is really strong,” says Ashfaq Sial, an entomologist at the University of Georgia. The insects go especially bonkers for plant material far enough past its prime that it’s begun to emit a particular parfum. And the longer the food decomposes, the more water content it will release—generating films of goo that can exacerbate the fly-luring smell.

The adults themselves aren’t necessarily the problem, but once they lay eggs, their hungry offspring will rapidly multiply. From there, it doesn’t take much for an infestation to unfold. Entomologists like Sial enjoy telling people that, left to their own devices for a year, a male fruit fly and a female fruit fly—the latter of which can lay hundreds of eggs during her brief lifetime—could theoretically coat the surface of the planet with their descendants, in a layer dense enough to “fill the space between the Earth and the moon” … twice. Let just a single individual in, and “they’re going to invite their friends,” says Monica Ozores-Hampton, a composting expert based in Florida. Ideally, “you should not allow even one.”

As tough as this might sound, it’s not impossible. The first step is prevention, Sial told me: Flies are sneaky and wont to infiltrating a home through open windows or doors, especially during the humid summer months; they can even hitch a ride atop freshly picked fruit. Keeping a kitchen relatively pristine reduces its appeal; it helps to have clean countertops, screened windows, and a garbage disposal that’s relatively well maintained, so no winged beasts are tempted to establish a colony inside. Produce can also be promptly cleaned to clear it of eggs, and much of it can be moved into the fridge.

And then there’s the matter of managing the actual food scraps. Several of the experts I spoke with, including Sherman, recommended keeping any waste destined for a composter in the freezer until you’re ready to port it outside. For anyone who, like me, would rather preserve their freezer’s real estate, flies can still be mostly waylaid by a tight-fitting lid on a countertop container, Ozores-Hampton told me. Transferring scraps nightly to a backyard composter or, as is the case for us, to a curbside pickup bin, can also cut down on in-house rot.

A solid lid isn’t a perfect deterrent. I’ve been using one for years, and still the fruit flies hover, as if waiting for me to lapse. So I recently added one final hack, per experts’ advice, and diluted the produce in my bin with some used paper towels and shredded news clips. The mix-in mimics an important step in proper composting, which “is all about the ratio,” says Molly Lindsay, the director of operations at Community Compost Company, which offers curbside pickup of food scraps in New York. Decomposition won’t go well unless the nitrogen in food waste is balanced out by sufficient infusion of carbon from something dry and brownish. Wood chips and sawdust are common additives, but even newspaper or bits of paper bags can spike in the right chemicals. (A scoop of finished compost, if handy, works great too.) As a perk, those same ingredients tend to absorb liquid, cutting down on leakage and slime. The trick worked for me: Almost overnight, the population of bin-stalking fruit flies in my kitchen seemed to halve.

These tactics won’t completely purge a kitchen of odor. The occasional waft of decay, plus a bit of condensation, is inevitable, says Gina Talt, who oversees the Sustainable Composting Research at Princeton Lab. In recent years, some retailers have taken to hocking super-pricey food-scrap collection containers with ventilated lids, fitted with carbon filters, that can cut down on some of the funk. But Sial pointed out that the lid’s perforations need to be only so wide to allow a determined female fly to wriggle her way through. Electric countertop composters also purport to deal with scraps quickly and cleanly, but many experts, including Lindsay, think they’re not worth their hefty price tag or the drain on your electricity bill. Plus, they may not work even a fraction as well as traditional composting methods. True to composting’s au naturel roots, the container in your kitchen doesn’t need to be any kind of fancy to accomplish its base task: separating true waste from what can be recycled—sans grossness!—into something good. An old yogurt or ice-cream container, or a piece of Tupperware past its prime, is solid enough to limit both the funk and the flies.