Red Wine Trap
Leftover red wine in a glass, plastic wrap with a few holes poked in it. Works especially well if the flies seem drawn to the wine rack or the recycling bin.
That's roughly how fast a fruit fly goes from egg to flying adult, which is why the trap catches today's flies while tomorrow's are already hatching somewhere you haven't found yet.
Check the drain, the recycling bin, the trash, and the fruit bowl before you do anything else.
Scrub the drain, empty and rinse the recycling and trash bins.
Vinegar in a jar, a few drops of soap, plastic wrap poked with tiny holes on top.
Swap the trap every 2–3 days until you go two full days without seeing one.
My mother keeps a bowl of fruit on the counter year round, and every August without fail it turns into a fruit fly convention. I spent a few summers just swatting at them before I sat down and actually figured out what gets rid of them for good, not just for an afternoon.
The fruit bowl gets blamed for all of it, but half the time it's not even the main problem. Fruit flies lay eggs anywhere there's a film of something sweet or rotting, and that's a longer list than most people think.
The vinegar and soap trap works for most kitchens, but a bad infestation or a specific room sometimes calls for something else alongside it.
Leftover red wine in a glass, plastic wrap with a few holes poked in it. Works especially well if the flies seem drawn to the wine rack or the recycling bin.
Good for a pantry or a spot near the stove where you don't want a liquid trap sitting out for days at a time.
When they're clustered on a window or the ceiling, a quick pass with a handheld vacuum knocks down a bad swarm while the trap does the slower work underneath.
If you've cleaned the fruit bowl and the trash and they're still around, especially near a sink, the drain is worth a closer look before you assume the trap just isn't working.
Most people don't have a fruit fly problem so much as a "gave up two days too early" problem.