Corn Flies: How to Get Rid of Them
In this article
Corn flies are small flying insects that gather around ripe or damaged corn, compost, and outdoor bins, and they lay eggs that hatch into maggots. They are not a cooking problem but a garden and kitchen-waste problem, and the fix is to remove what attracts them and keep it covered. The steps below cover the source, the traps, and the cleanup that ends the cycle.
What Corn Flies Are
Corn flies is a common name for small flies that appear around sweet corn, field corn, and decaying plant matter. They are typically 1/8 to 1/4 inch (3 to 6 mm) long, dark-bodied, and weak fliers that rise in a cloud when you disturb a bin or a pile of husks. The adults feed on moisture and sugars from damaged kernels, and the females lay eggs in damp organic material. The larvae are small white maggots that feed for a few days before pupating in the soil or in the bottom of a container. The entire cycle can finish in about 7 to 14 days in warm weather, which is why a single forgotten bag of corn can turn into a swarm.
They are not the same as fruit flies, though the two often appear together. Fruit flies are tan with red eyes and hover over ripe fruit and fermenting liquids. Corn flies are darker and cluster on corn, husks, and wet grain. The distinction matters because the bait and the cleanup differ slightly, but the removal steps below work for both.
Find the Source First
Traps will not fix a population that is still breeding. Walk the area and check these spots in order:
- Corn husks, cobs, and silks in a compost bucket, bin, or pile.
- Outdoor trash cans, especially those with loose lids or liquid at the bottom.
- Recycling bins with food residue or sweet drink bottles.
- Garden beds where corn was harvested and dropped kernels remain.
- Pet food bowls, bird feeders, and fallen fruit under trees.
- Indoor kitchen bins, sink drains, and mop buckets.
Open each container and look for maggots, pupae, or a damp layer of rotting material. The source is usually the wettest, sweetest spot within about 30 feet (9 m) of where the flies are worst. Remove that material first; everything else is secondary.
Remove and Bag the Waste
Put on gloves and scoop the rotting corn, husks, and any wet material into a sealed plastic bag. Tie the bag closed and place it in an outdoor bin with a tight lid. Do not put it in an open compost pile; corn flies breed in uncovered compost. If the material is already full of maggots, double-bag it and take it out the same day. Scrape the bottom of the bin and wash it with hot soapy water, then rinse and let it dry in the sun. A 10% bleach solution (about 1/2 cup (120 ml) bleach in 1 gallon (3.8 L) water) can be used on hard bins, but rinse well and let them dry before reuse.
Dry Out the Breeding Spots
Corn flies need moisture. After removing the waste, dry the area. Fix leaky outdoor taps, empty saucers under pots, and spread wet mulch or grass clippings so they can dry. Keep compost in a closed tumbler or a bin with a lid, and turn it regularly so it heats and dries. If you keep a compost pile, bury food scraps at least 12 inches (30 cm) deep in the center and cover them with dry brown material. Do not add corn cobs or husks to an open pile during fly season; bag them for municipal pickup instead.
Set Traps for the Adults
Traps reduce the adults that are already flying while you fix the source. Place them at the edges of the problem area, not next to the house, because traps attract flies.
- Apple cider vinegar trap: Pour 1/2 cup (120 ml) apple cider vinegar into a jar, add 2 drops of dish soap, and cover the top with plastic wrap. Poke 4 to 6 small holes in the wrap. The soap breaks surface tension so the flies sink. Replace the liquid every 3 to 4 days.
- Yeast trap: Mix 1 tablespoon (12 g) sugar, 1 teaspoon (3 g) active dry yeast, and 1 cup (240 ml) warm water in a jar. Cover with wrap and holes as above. This bait is stronger for corn flies and fruit flies in warm weather.
- Sticky cards: Hang yellow sticky cards near corn plants and bins. They catch adults on contact and show you where the population is concentrated.
Empty and refresh traps every few days. A trap that is full of dead flies stops working and starts to smell.
Protect Corn at Harvest
Pick corn as soon as it is ripe; overripe kernels split and leak sugar that draws flies. Harvest in the morning when it is cool, and do not leave picked ears in a pile on the ground. Husk corn over a bag or bucket so the husks go straight into a sealed container. If you grow corn, remove spent stalks and dropped ears at the end of the season rather than leaving them in the bed. Keep the soil surface raked and dry around the plants.
Keep the Kitchen Clear
Indoor corn flies usually come in on produce or through a window. Store corn in the refrigerator in a sealed bag, and use it within 2 to 3 days. Wipe up juice and crumbs, take out the trash daily during fly season, and keep a lid on the kitchen bin. Check the bottom of the bin for liquid and wash it weekly. If flies are already indoors, a bowl of the vinegar trap on the counter will catch them, but the source is still the priority.
When the Flies Persist
If the swarm continues after the source is gone, look further out. Check gutters, drain lines, and areas where water pools. Corn flies can breed in wet leaf litter and in the bottom of rain barrels. Empty and clean rain barrels, and clear gutters so they dry between rains. For a heavy outdoor infestation, a residual insecticide labeled for outdoor use can be applied to resting surfaces such as bin lids and fence lines, following the label exactly. Do not spray corn plants or anything that will be eaten, and keep sprays away from pets and children. If flies are entering the house, check window screens and door sweeps for gaps and repair them.
How Long It Takes
Removing the source stops new adults within about 7 to 14 days, the length of one life cycle. Traps will clear the remaining adults in 3 to 5 days if refreshed. If you still see clouds of flies after 2 weeks, a second source has been missed. Recheck compost, bins, and any damp organic material within 30 feet (9 m) of the problem area.