Compost piles are attractive to fruit flies and fungus gnats. Fruit flies are attracted to the food, and fungus gnats are attracted to the moisture and fungus. Fruit flies enter our homes as larvae on the skin of fruit we bring home from the market, according to the Massachusetts Department of Environmental Protection. Fungus gnats are often present in potting soil and will make their way to an attractive compost pile.
What you think are gnats may be fruit flies. Fruit flies are yellow or slightly orange in color and have a round shape, while gnats have thinner bodies and are all black in color. Fruit flies, of course, are attracted to fruit, while fungus gnats are common in homes that also have houseplants.
Fruit Fly Control Indoors
The Massachusetts Department of Environmental Protection recommends luring fruit flies into a banana trap. Place a peel in a plastic container and close it. Punch four holes in the lid large enough for the fruit flies to crawl through. The flies will be drawn to the peel in droves so empty the container every day for three or four days. This should solve the problem.
Consider emptying the indoor compost every day. This will eliminate the flies’ and gnats’ main food source. If you find that you still have fungus gnats flying around, even with no compost in the house, check your houseplants. Houseplants are a common host of fungus gnats. Let the soil dry out to at least an inch deep to drive the flies deeper into the soil.
For fly and gnat problems in outdoor compost piles, WalterReeves.com recommends burying each new addition of scraps in the pile and then covering the site with leaves or grass clippings. Leaves and grass clippings are not attractive to these pests, and should keep them at bay. It is possible that your compost pile is imbalanced: you may have too much “green” material and not enough “brown,” carbon-rich material. Add straw, shredded brown paper bags and ripped up egg cartons along with your kitchen scraps until the problem subsides.