Gnat Trap Options for Fruit Flies and Fungus Gnats

The most effective gnat trap depends on which type of gnat you’re dealing with. Fungus gnats, fruit flies, and drain flies all look similar at a glance, but they breed in different places and respond to different lures. A trap that works perfectly for fruit flies may do nothing for fungus gnats, and vice versa. Identifying your pest first saves you from wasting time on the wrong approach.

Identify Your Gnat First

The tiny flies people call “gnats” usually fall into three categories, and each one requires a different strategy.

  • Fruit flies are the most common kitchen pest, less than 1/8 inch long with rounded bodies and red or dark eyes. They hover around ripe fruit, compost bins, and anything fermenting. They’re small enough to pass through standard window screens.
  • Fungus gnats look more mosquito-like, with noticeably long legs and long segmented antennae. You’ll see them crawling on the soil of houseplants or flying weakly near windows. Their larvae live in moist potting soil.
  • Drain flies are fuzzy, moth-shaped flies that rest on bathroom walls near sinks, showers, or floor drains. They breed in the organic film that builds up inside pipes.

If the gnats are concentrated around your plants, you’re dealing with fungus gnats. If they swarm near your fruit bowl or trash can, they’re almost certainly fruit flies. If they appear in bathrooms, start with your drains.

Traps for Fruit Flies

Fruit flies are attracted to the smell of fermentation, which makes them easy to lure. The classic DIY trap uses apple cider vinegar: pour about half an inch into a jar or small bowl, add a drop of dish soap to break the surface tension, and cover the opening with plastic wrap poked with a few small holes. Flies enter through the holes, land on the liquid, and can’t escape. The dish soap is critical because without it, fruit flies can sit on the surface and fly away.

Red wine, overripe banana pieces, or any fermenting fruit juice works as a substitute for vinegar. Commercial fruit fly traps use the same principle with a pre-made lure and a funnel-shaped entry. Replace the bait every few days, since it loses potency as it dries out or gets saturated with dead flies.

Traps alone won’t solve a fruit fly problem if the breeding source remains. A single piece of forgotten fruit, a damp mop head, or residue in a recycling bin can sustain a population indefinitely. Remove or clean every potential food source, and the traps will catch the remaining adults within a few days.

Traps for Fungus Gnats

Fungus gnats respond to visual cues rather than food smells, so vinegar traps are largely useless against them. Yellow sticky traps are the standard tool. These are small cards coated in non-drying adhesive, mounted on stakes pushed into the soil of potted plants. Adult gnats are drawn to the yellow color, land on the surface, and get stuck. Research from Leibniz Universität Hannover found that fungus gnats are most attracted to UV light and green-yellow wavelengths, which explains why yellow traps outperform other colors. The same research showed that UV LED traps were even more attractive to fungus gnats than conventional yellow cards.

Place one sticky trap per pot for small to medium plants, or several around larger containers. Position them just above the soil surface where adults are most active. Check the traps every few days. If you’re catching dozens of gnats, you have a significant population breeding in the soil.

Killing Larvae in the Soil

Sticky traps catch adults but don’t touch the larvae feeding on organic matter in your potting mix. To break the breeding cycle, you need to target both life stages. Fungus gnats develop from egg to adult in about 17 days at 75°F: eggs hatch in roughly 3 days, larvae develop over about 10 days, and pupae emerge as adults after another 4 days. Warmer rooms speed this up, which is why infestations can explode quickly indoors.

The simplest control method is letting the top inch or two of soil dry out completely between waterings. Fungus gnat eggs and young larvae need consistent moisture to survive, and dry soil kills them. This works well for most houseplants that tolerate some drying, though it’s not ideal for moisture-loving species like ferns.

For a more aggressive approach, Cornell Cooperative Extension recommends a hydrogen peroxide soil drench: mix one part standard 3% hydrogen peroxide with four parts water and pour it over the soil as you would normally water. The solution fizzes on contact with larvae and kills them without harming plant roots. Let the soil dry out afterward to prevent reinfestation. One or two treatments, spaced a week apart, typically clears an infestation when combined with sticky traps for the adults.

A layer of coarse sand or decorative gravel on top of the soil also helps. It creates a dry barrier that prevents adult females from laying eggs in the moist soil below. About half an inch is enough to deter egg-laying while still allowing water to pass through.

Traps for Drain Flies

Drain flies breed in the slimy biofilm inside pipes, so traps are only a temporary measure. You can catch adults with sticky traps placed near problem drains, or by setting a small dish of vinegar and soap near the drain opening overnight. But the real fix is cleaning the drain itself. A stiff drain brush physically removes the film where larvae develop. Pouring boiling water down the drain daily for a week, or using an enzyme-based drain cleaner that digests organic buildup, addresses the root cause. Once the breeding site is gone, adults die off within a couple of weeks.

DIY vs. Store-Bought Traps

For fruit flies, homemade vinegar traps work just as well as commercial options. The commercial versions are mostly a convenience factor, offering a neater design and pre-mixed lure. For fungus gnats, store-bought yellow sticky traps are inexpensive (usually a few dollars for a pack of 10 or more) and hard to replicate at home since the adhesive needs to stay tacky for weeks without drying out. UV LED traps designed for fungus gnats exist and are more effective than yellow cards based on the research, but they cost significantly more and are mainly used in greenhouses.

Electric plug-in traps that use UV light and a sticky board or fan can catch multiple types of small flies. They work reasonably well as a general solution if you’re not sure what you’re dealing with, but they’re less targeted than matching the right trap to the right pest.

Preventing Gnats From Coming Back

Most indoor gnat problems come down to moisture and organic matter. Overwatered houseplants are the top cause of fungus gnats. Switching to a bottom-watering routine, where you fill the saucer and let the plant absorb water upward, keeps the soil surface drier and less hospitable to egg-laying adults. Storing fruit in the refrigerator instead of on the counter eliminates the primary breeding site for fruit flies. Emptying kitchen trash frequently, rinsing bottles and cans before recycling, and wiping down sink drains all remove the organic residue these insects depend on.

New bags of potting soil can come pre-loaded with fungus gnat eggs or larvae. If you’ve had recurring problems, consider microwaving small batches of soil for a couple of minutes before potting, or choosing a well-draining mix with plenty of perlite that doesn’t stay waterlogged.