How to Get Rid of Fruit Flies Fast and Keep Them Out

Removing the breeding source is the single most important step to get rid of fruit flies. Traps help, but they only catch adults. A female fruit fly lays up to 100 eggs per day, and those eggs hatch in about 24 hours, so any strategy that ignores where the flies are reproducing will fail. The full cycle from egg to adult takes just 10 to 12 days at room temperature, which means a small problem becomes a big one fast.

Find and Remove Every Breeding Source

Overripe bananas on the counter are the obvious culprit, but fruit flies breed in any moist spot with fermenting organic material. The places people overlook are often the places keeping the infestation alive. Check these common but easy-to-miss locations:

  • Recycling bins and bottles. Old ketchup bottles, beer cans, and wine bottles with residue inside are prime breeding grounds.
  • The bottom of your trash can. Even after you take the bag out, caked-on food residue at the bottom of the bin provides everything fruit flies need.
  • Dirty mops, rags, and sponges. Anything soaked with food-laden water or that smells sour can host eggs.
  • Refrigerator drip pans. The drain pan underneath your fridge collects moisture and organic matter you never see.
  • Potted plants. Wet, decaying soil or rotting bulbs attract fruit flies looking for somewhere to lay eggs.
  • Floor drains. Drains that aren’t used often accumulate a layer of fermenting organic buildup inside the pipe.

Go room by room. If you still see fruit flies two or three days after your first cleanup, you’ve missed a source. That persistent cloud of tiny flies is telling you there’s still something wet and fermenting somewhere nearby.

Clean Your Drains Properly

Drains are a surprisingly common breeding site. Inside the curved section of your pipes (the P-trap), a slimy biofilm of bacteria, grease, hair, and food residue builds up over time. Fruit flies lay their eggs directly into that film, and the larvae feed on it for one to two weeks before emerging as adults.

Two popular fixes don’t work well here. Bleach slides over the slime without actually breaking it down. Boiling water cools too quickly as it travels through the pipe to reach the buildup in the trap. What does work is an enzymatic or bacterial drain cleaner, the kind designed to digest organic material rather than just disinfect it. Pour it down the drain before bed and let it sit overnight. These products use natural bacteria and enzymes to eat through the grease and food particles that fruit flies depend on. You may need to repeat this for a few nights to fully clear the film.

Before using the enzymatic cleaner, physically scrub the drain opening with a stiff brush to remove any buildup you can reach. That combination of mechanical cleaning and overnight enzymatic treatment is far more effective than either step alone.

Build a Simple Trap

While you’re eliminating breeding sources, traps reduce the adult population so fewer flies are laying eggs. The most reliable DIY option uses apple cider vinegar and a drop of dish soap in a small jar or bowl. The vinegar smells irresistibly sweet to fruit flies, drawing them in. The dish soap breaks the surface tension of the liquid so the flies can’t land on top. Instead, they sink and drown.

Pour about half an inch of apple cider vinegar into a glass or jar, add one or two drops of liquid dish soap, and set it near your fruit bowl or wherever you see the most activity. Some people cover the jar with plastic wrap and poke small holes in it, which makes it harder for flies to escape once they enter. Replace the vinegar every two to three days as it loses its potency.

You can set out multiple traps in different rooms. They won’t solve the problem on their own, but paired with source removal, they accelerate the process significantly.

Do Plug-In Traps and UV Lights Work?

Small plug-in UV light traps with sticky pads are widely sold for fruit flies, and results are genuinely mixed. Some users report catching dozens of flies over a few weeks, while others catch almost nothing despite visible infestations in the same room. The small UV lights in consumer products are roughly as bright as a nightlight, which limits their range of attraction. Larger commercial fly zappers perform better, but they’re designed for restaurants and garages, not kitchens.

If you want to try a plug-in trap, treat it as a supplement to source removal and vinegar traps, not a replacement. Sticky window traps placed near fruit bowls or trash cans can also catch stragglers passively. None of these tools address the root cause. As one pest control professional put it: they catch flies, but addressing the source is the real cure.

How Long Until They’re Gone

Once every breeding source is removed, the timeline depends on how many flies are already in the adult and pupal stages. Adult fruit flies live roughly 7 to 10 days. Pupae that are already developing in hidden spots will continue to emerge for up to two weeks. In most cases, you’ll see a dramatic drop within two to three days of a thorough cleanup, with stragglers appearing for another week or two.

Some infestations take closer to 30 days to fully resolve if breeding sites were well established. If you’re still seeing significant numbers after a week, that’s a strong signal you haven’t found every source. Revisit the list above and check spots you may have dismissed the first time, especially drains, the underside of trash cans, and the recycling bin.

Preventing the Next Infestation

Fruit fly eggs often hitch a ride into your home on produce from the grocery store. Rinsing fruits and vegetables as soon as you get home washes off any eggs on the surface before they have a chance to hatch. Dry the produce thoroughly afterward, since moisture is what fruit flies need most.

Store ripe fruit in the refrigerator whenever possible. Bananas, tomatoes, and stone fruits left on the counter at room temperature are the most common triggers for a new infestation. If you prefer to keep fruit out, eat it within a day or two and check daily for soft spots or bruising. Take out kitchen trash and compost every evening, or use a bin with a tight-sealing lid. Rinse recyclables before tossing them in the bin, especially anything that held juice, beer, wine, or condiments. Wipe down counters where fruit has been sitting, since even a thin film of juice is enough to attract flies and give them a place to lay eggs.