How to Get Rid of Flies Fast and Keep Them Out

Getting rid of flies starts with two things: removing what attracted them and killing the ones already inside. The approach depends on which type of fly you’re dealing with, since house flies, fruit flies, and drain flies breed in completely different places and respond to different controls. Most fly problems can be resolved within a week or two using a combination of sanitation, traps, and physical barriers.

Identify Which Fly You Have

House flies are the large, gray flies that buzz around your kitchen and land on food. They breed in decaying organic matter outside, like garbage bins, pet waste, and compost piles. A single female lays 350 to 900 eggs in her lifetime, and under warm conditions, eggs hatch in as little as eight hours. The full cycle from egg to adult takes as few as six days in summer, which is why a small problem becomes a big one fast.

Fruit flies are tiny, tan or brown flies that hover around ripening fruit, drains, and anything fermenting. They’re about a third the size of a house fly. If you see small flies clustered near your fruit bowl, recycling bin, or wine glasses, these are almost certainly what you’re dealing with.

Drain flies are fuzzy, moth-like flies that sit on bathroom walls near showers and sinks. They breed inside the slimy organic buildup (called biofilm) that coats the inside of drain pipes. If you notice them mostly in bathrooms or near floor drains, biofilm is your target.

Remove Their Food and Breeding Sources

No trap or spray will solve a fly problem permanently if the breeding source stays in place. For house flies, the most common culprits are uncovered trash cans, pet waste left in the yard, and compost bins too close to the house. Take garbage out frequently, keep lids sealed, and clean the inside of trash cans with soapy water every couple of weeks. If you have a dog, pick up waste daily.

For fruit flies, clear your counters of overripe fruit, empty recycling bins that held beer or wine bottles, and wipe down any sticky surfaces where juice or soda spilled. Even a thin residue of something sweet is enough for fruit flies to feed and lay eggs. Move ripening fruit into the refrigerator until the problem clears.

For drain flies, the target is the biofilm lining your pipes. Pouring bleach down the drain is a common instinct, but it doesn’t work well. Bleach kills adult flies on contact, but it can’t penetrate the structured biofilm where larvae are embedded. New adults emerge within days. Enzyme-based drain cleaners are a better option because they break down the organic matter that makes up the biofilm, though they work slowly and need repeated applications over several days. The most effective mechanical approach is to scrub the inside of the drain opening with a stiff brush, physically removing the buildup where larvae live.

Set Up Traps for Flies Already Inside

Traps won’t stop a breeding cycle on their own, but they’re excellent for knocking down the adult population while your sanitation efforts take hold.

Apple Cider Vinegar Trap for Fruit Flies

Fill a small jar with about a quarter cup of apple cider vinegar and add a few drops of liquid dish soap. The vinegar’s fermentation smell draws fruit flies in, and the soap breaks the surface tension of the liquid so they can’t land on it without sinking. Punch a few small holes in the lid or cover the jar with plastic wrap and poke holes with a toothpick. The holes let flies enter but make it hard for them to find their way back out. Place one near the kitchen sink and another near the fruit bowl. Replace the vinegar every two to three days.

UV Light Traps for House Flies

Indoor light traps use ultraviolet bulbs that peak in the 360 to 370 nanometer range, a wavelength that’s highly attractive to house flies. These plug-in units draw flies onto a sticky glue board or into an electric grid. They work best in rooms where flies are most active, like kitchens and entryways. Place them at about eye level or slightly lower, and away from competing light sources like windows, so the UV glow is the most attractive thing in the room.

Sticky Fly Strips

Old-fashioned ribbon strips hung from the ceiling are surprisingly effective for house flies in garages, mudrooms, or near trash areas. They’re not elegant, but a single strip in the right spot can catch dozens of flies over a few days.

Keep Flies From Getting Inside

Physical exclusion is the most reliable long-term solution. Standard window and door screens with 18 to 20 mesh (meaning 18 to 20 holes per inch) block house flies, mosquitoes, and most common flying insects while still allowing good airflow. That mesh size handles house flies easily since they’re 4 to 7.5 millimeters wide. If gnats are also a problem, you’ll want 30-mesh screens. For the tiniest biting midges (no-see-ums), you’d need 50-mesh or finer, though screens that tight reduce airflow and visibility noticeably.

Check your existing screens for tears, gaps at the edges, and frames that don’t sit flush in the window track. Even a small gap is an open door for flies. Seal around door frames with weatherstripping, and if you use a sliding door frequently in summer, consider adding a magnetic screen door that closes automatically behind you.

Outdoor Traps and Yard Management

If house flies are breeding somewhere in your yard, baited outdoor fly traps can dramatically reduce the population before flies reach your doors. The disposable bag-style traps use water-activated attractants that lure flies in through a funnel they can’t escape. The key detail most people miss is placement: hang these traps at least 20 feet away from your house, patio, or any area where you spend time. Placed too close, they’ll actually draw more flies toward you. Good locations include along a back fence, near garbage bins, beside a compost pile, or near a dog run.

Beyond traps, a few yard habits make a big difference. Keep grass trimmed, since tall vegetation holds moisture and organic debris that flies use for breeding. Move compost bins as far from the house as practical. If you have chickens, rabbits, or other animals, clean their areas frequently. Manure is one of the most productive house fly breeding sites, with six to eight generations per year emerging from a single habitat.

What About Sprays and Insecticides

Aerosol fly sprays kill flies on contact but do nothing to prevent new ones from arriving. They’re useful for a quick knockdown when you have company coming over, but they’re not a solution on their own. Residual surface sprays applied around doorframes and window edges can kill flies that land on treated surfaces for several weeks, which helps in buildings where exclusion is difficult, like older homes with imperfect seals or businesses with frequently opening doors.

For fruit flies or drain flies, insecticides are largely unnecessary. These species respond so well to source removal and traps that chemicals add cost and exposure without much benefit. If you’ve cleaned drains, removed ripe fruit, and set traps, the adult population will crash within a week as the existing generation dies off without being replaced.

Why Flies Matter Beyond Annoyance

House flies are mechanical vectors for several serious pathogens. They land on decaying matter, animal waste, and garbage, picking up bacteria on their legs and mouthparts, then transfer those organisms directly to your food and kitchen surfaces. House flies can transmit salmonella, cholera, and shigella, among other disease-causing bacteria. This is why food left uncovered during a fly problem carries real risk, not just an “ick” factor. Covering food, wiping prep surfaces, and washing produce become more important when flies are active in your home.

A Practical Timeline

Day one, identify the fly type and remove breeding sources. Set traps the same day. By day two or three, you should see adult flies accumulating in your traps, confirming they’re placed correctly. Over the next five to seven days, the existing generation of adults dies off. If no new breeding material is available, the population collapses. If you’re still seeing the same number of flies after ten days, you’ve missed a breeding source. Recheck garbage areas, drains, hidden fruit (like a potato that rolled behind a bin), and any standing organic matter. For drain flies specifically, you may need to repeat enzyme treatments or mechanical scrubbing over two to three weeks to fully clear deep biofilm.