Small Fly Traps That Work for Fruit Flies and Gnats

The best small fly trap depends on which fly you’re dealing with. Fruit flies, fungus gnats, and drain flies each respond to different baits and trap styles, so a vinegar trap that works perfectly for fruit flies will do almost nothing for gnats hovering around your houseplants. Identifying the fly first saves you days of frustration with the wrong approach.

Identify Your Fly First

The three most common small flies in homes are fruit flies, fungus gnats, and drain flies. All are roughly 1/8 inch long, but they look and behave differently enough that you can tell them apart in seconds.

Fruit flies have tan-brown bodies with darker rear ends and distinctive bright red eyes. They hover slowly and lazily around fruit bowls, sinks, and garbage cans. If you see tiny flies floating near your kitchen counter, these are almost certainly the culprit. They breed in fermenting or overripe produce, sticky spills, wine or beer residue, and garbage disposals with food particles.

Fungus gnats are slender, dark gray or black, with long delicate legs and small dark eyes. Their flight is weak and erratic. You’ll notice them making short, unsteady flights near houseplants, especially when you water or disturb the soil. They breed in the top half-inch of consistently moist potting soil.

Drain flies look completely different from the other two. They have fuzzy, moth-like wings that form a heart shape when resting. You’ll typically spot them sitting on bathroom walls or near sink drains. They breed in the slimy organic film that builds up inside pipes.

The Best DIY Fruit Fly Trap

For fruit flies, a simple vinegar trap outperforms most other homemade options. Fill a small jar or cup with about 1/4 cup of apple cider vinegar and add a few drops of liquid dish soap. The vinegar smells irresistibly sweet to the flies, drawing them in. The dish soap breaks the surface tension of the liquid so the flies can’t land on it and take off again. Instead, their wings get weighed down and they sink.

The type of vinegar matters more than you might think. A study at Texas A&M University compared different baits and found that distilled white vinegar caught only 2 fruit flies while red wine caught 33 in the same time period. Apple cider vinegar performs much better than white vinegar, likely because it’s sweeter and more closely mimics fermenting fruit. If you have leftover red wine, that may actually work even better than vinegar. Soda, by comparison, caught zero fruit flies in the same experiment.

To boost your trap’s effectiveness, you can cover the jar with plastic wrap and poke several small holes in it. Flies enter through the holes but struggle to find their way back out. Place traps near the areas where you see the most activity: fruit bowls, trash cans, recycling bins, and sink drains.

Yellow Sticky Traps for Fungus Gnats

Vinegar traps don’t work well for fungus gnats. What does work is yellow sticky traps, those small yellow cards coated on both sides with adhesive. Fungus gnats are strongly attracted to the yellow color and get stuck on contact. According to the University of California’s Integrated Pest Management Program, yellow sticky traps reliably capture fungus gnat adults along with other small flying pests like whiteflies and thrips.

Placement makes a real difference. Position the trap horizontally near the soil surface of infested plants, since fungus gnats emerge from and rest on the growing medium. If you’re placing traps vertically, keep the bottom edge even with the top of the plant canopy. For traps to solve the problem long-term, you also need to address the moisture in your soil. Let the top inch of potting mix dry out between waterings. Fungus gnats need consistently damp, organic-rich soil to breed, and drying out that top layer breaks their life cycle. At 75°F, fungus gnats develop from egg to adult in about 17 days, so you’ll need to keep traps in place for at least three weeks to catch emerging adults.

Clearing Drain Flies

Drain flies don’t respond to vinegar traps or sticky cards because their world revolves around your plumbing. They breed in the slimy organic buildup coating the inside of drain pipes, and the adults rarely stray far from their breeding site. Killing the adults you see on the wall is pointless if the biofilm in the pipe keeps producing new ones.

The real fix is cleaning the drain. Start by physically removing buildup with a stiff drain brush, then follow up with an enzyme-based drain cleaner. These products use naturally occurring microorganisms and enzymes in a thick gel that clings to pipe walls, digesting the organic film that drain flies depend on. They work without harsh chemicals, which matters because bleach and boiling water often fail to fully remove the buildup and can damage certain pipes. You’ll typically need to treat the drain for several consecutive nights (drain flies are most active at night) to fully eliminate the breeding site.

Plug-In and UV Light Traps

If you’d rather not deal with open containers of vinegar or sticky cards, plug-in traps that use light to attract flies are a hands-off alternative. These devices combine blue and UV LEDs with an adhesive backing sheet. Flying insects are drawn to the light, land on the sticky surface, and get trapped. They work on fruit flies, fungus gnats, and house flies.

The main advantage is convenience and cleanliness. There are no chemical insecticides involved, no odors, and no liquid bait to spill. Some models use a curved shield that keeps trapped insects hidden from view, which also helps prevent curious pets or children from picking at the adhesive. That said, these traps are still best kept out of reach of small kids and pets. They work well as a supplement to source removal but won’t solve an infestation on their own if the breeding site is still active.

How Long Traps Need to Stay Active

This is where most people go wrong. They set a trap, catch a satisfying number of flies in two days, then take it down. A week later the flies are back. The reason is simple: traps only catch adults, and the next generation is already developing out of sight.

Fruit flies complete their entire life cycle, from egg to flying adult, in about 11 to 12 days at room temperature (around 72°F). At a slightly warmer 77°F, that shrinks to 9 or 10 days. At cooler temperatures near 64°F, development takes roughly twice as long. Females become sexually mature within 8 to 10 hours of emerging, so a single surviving female can restart the whole cycle almost immediately.

To fully break the cycle, keep your traps in place for at least two to three weeks after you stop seeing new flies. This ensures you catch any adults emerging from eggs or larvae that were already present when you started trapping. During that entire window, you also need to eliminate the breeding source. For fruit flies, that means tossing overripe produce, cleaning sticky residues, and scrubbing garbage disposals. For fungus gnats, it means letting soil dry out. For drain flies, it means treating the pipe. Traps without source removal are just a holding action.

Preventing Small Flies From Coming Back

Once you’ve cleared an infestation, a few habits keep it from returning. Store ripe fruit in the refrigerator, especially bananas and tomatoes in summer. Rinse bottles and cans before putting them in recycling. Wipe down counters and sink basins to remove sugary residue or alcohol spills. Run your garbage disposal with plenty of water after every use.

For houseplants, switch to a well-draining potting mix and avoid watering on a schedule. Water only when the top inch of soil is dry to the touch. Adding a thin layer of sand or decorative gravel on top of the soil can also discourage fungus gnats from laying eggs. For drains, running an enzyme cleaner through kitchen and bathroom drains once a month prevents the organic film from building up to levels that support drain fly breeding.