How to Get Rid of Flies in the House: A Lasting Plan
Learn how to get rid of flies by identifying the species, removing breeding sites, sealing entry points, choosing traps, and knowing when to call a pro.

If you want to know how to get rid of flies, start with the thing that keeps producing them. Swatting adults or spraying the air can give you a quieter room for an hour, but a wet trash residue, drain film, pet waste, fallen fruit, or open window can keep the next wave coming.
The practical order is identify the fly, remove its food or breeding material, close the entry route, catch the adults that remain, and check the result. That sequence follows integrated pest management: the CDC describes it as inspection, identification, threshold-setting, using more than one control measure, and evaluating whether the measures worked. CDC integrated pest management guidance frames fly control as a system, not a single magic product.
Start by identifying the fly instead of treating every small insect the same
“Flies” is a useful everyday word but a poor diagnosis. A large gray fly landing on a window, a cloud of tiny tan flies over a fruit bowl, fuzzy insects lifting from a sink, and black specks circling a houseplant may all need different first actions. You do not need a microscope to choose a sensible first step, but you do need to notice size, color, flight pattern, and where the insects gather.

Use this quick field guide as a starting point, not as a substitute for professional identification when the problem is severe:
| What you notice | Most likely group | First place to inspect |
|---|---|---|
| Gray fly, about a quarter-inch or larger, often resting on walls or windows | House fly or related nuisance fly | Trash, pet waste, compost, rotting outdoor material, screens |
| Shiny blue, green, or copper body; sudden cluster indoors | Blow fly | Meat waste, outdoor bins, a dead animal in a wall, attic, or crawlspace |
| Tiny tan or yellowish flies around fruit, wine, juice, or recycling | Fruit or vinegar fly | Produce, bottle residue, kitchen compost, disposal, drain film |
| Tiny fuzzy, moth-like flies that rise from a sink or floor drain | Drain fly | Organic slime inside the drain and overflow opening |
| Tiny dark flies that walk or drift around potting mix | Fungus gnat | Constantly damp houseplant soil or seed-starting mix |
The fly you see is not always the place it developed. Adult house flies commonly enter from outside, while fruit flies can arrive in produce and then multiply indoors. A few blow flies around a window can be a clue to something decomposing out of sight rather than a dirty kitchen. Treat the location that explains repeated activity, not just the surface where adults happen to land.
House flies and blow flies point to different sources than fruit flies
The common house fly, Musca domestica, is gray and has four dark stripes on its thorax. It does not bite; it has sponging mouthparts and feeds on liquids. It can, however, move between waste and food-contact surfaces, which is why flies should be kept away from uncovered meals and why sanitation is more than a cosmetic concern.
UC Statewide IPM notes that house flies develop in warm, moist organic material such as manure, garbage, grass clippings, and decaying fruits and vegetables. Under favorable summer conditions, development can be very fast, so a problem may seem to “appear overnight.” The same UC IPM fly guide also explains that eliminating larval habitat is more useful for long-term suppression than repeatedly killing adults.
Blow flies are often larger and metallic. If several appear suddenly, especially when there is no obvious food source, inspect outdoor garbage, pet-waste areas, chimney or attic spaces, wall voids, and crawlspaces. A professional is the right next step if you suspect a dead animal inside the structure; opening walls or spreading contaminated material can make a contained problem larger.
Fruit flies gather around fermenting food
Fruit flies are much smaller than house flies and often have tan bodies and conspicuous eyes. They favor fermenting or sugary material: an overripe banana, a sticky bottle, a recycling container with residue, a kitchen compost caddy, a damp mop head, or a thin film in a drain. The fruit bowl is an obvious suspect, but the source can be the underside of a lid or a spill under an appliance.
For a small fruit-fly problem, an apple-cider-vinegar trap can reduce adults while you remove the source. It is a trap, not a breeding-site treatment and not proof that every fly in the home is a fruit fly. A bowl or jar with vinegar and a tiny amount of dish soap can work; covering it with plastic wrap and making small entry holes can slow escape. Keep it away from children, pets, and food preparation, and refresh it when the liquid becomes dirty.
Drain flies and fungus gnats need moisture-focused fixes
Drain flies are fuzzy and weak-flying. They often sit on the wall beside a sink or shower, so the repeated location is a useful clue. The adults are the visible symptom; the breeding layer is usually an organic film inside a drain, overflow channel, floor drain, or seldom-used fixture. Pouring a scented liquid down the drain may change the smell without removing the film.
Fungus gnats are tiny dark flies that stay close to houseplant soil. The RHS explains that sciarid-fly larvae thrive in damp compost containing decaying organic material, while established plants usually tolerate minor feeding better than seedlings and soft cuttings. RHS fungus-gnat guidance supports a different response from house-fly control: allow the mix to dry as the plant permits, use fresh suitable potting media if needed, and place sticky cards near soil level.
Do not confuse every harmless garden fly with a household pest. Hoverflies can resemble bees or wasps, but they do not bite or sting and many larvae prey on aphids or recycle organic material. The RHS guide to hoverflies is a useful reminder to identify before spraying outdoor vegetation. If the insects are hovering over flowers outside and not entering the home, tolerance may be better pest management than blanket treatment.
Find the breeding source before you buy another trap
The most important inspection question is: what is wet, edible, and sitting undisturbed? Walk from the room where you see flies outward, then check the adjacent exterior. Look under, behind, and inside containers rather than only wiping visible counters. A successful inspection should end with one or more concrete sources to remove, dry, seal, or repair.

Inspect the kitchen and pantry in a deliberate loop
Start with the trash can, recycling, compost container, and the floor around them. Tie off food waste before carrying it through the house. Wash the inside and underside of the lid with hot soapy water, rinse, and dry the container before inserting a fresh liner. A clean liner in a dirty can is not a complete reset.
Next check the fruit bowl, onions and potatoes, reusable grocery bags, beverage cans, wine bottles, syrup bottles, and the sticky underside of a countertop appliance. Rinse recyclables before storing them. Pull out the refrigerator or stove if activity persists and look for a sweet or greasy spill that has reached the floor or a wall gap.
Check pet bowls, litter areas, and indoor toilet pads daily during a flare-up. Outdoors, remove feces and fallen fruit promptly and inspect the area where a pet rests. Gardening Know How’s practical fly guidance also flags exposed compost, uncovered food, damaged screens, and fallen fruit as common invitations; its fly-attracting mistakes guide is useful for turning a general “clean more” instruction into a source checklist.
Test drains and other hidden moisture zones
If small flies gather near a sink, do not assume they flew in from the window. Place a loose clear bag or an inverted sticky card over the drain overnight without blocking a fixture that must remain ventilated. Activity beneath the cover is a clue, not laboratory confirmation, but it tells you where to concentrate effort.
Remove and wash the stopper, strainer, and overflow cover if the fixture allows it. Scrub the inside walls you can reach with a stiff drain brush, then flush according to the fixture and product directions. The physical removal matters because larvae can live in the organic coating rather than in the open water. Repeat the inspection after several nights; one rinse rarely proves that a hidden film is gone.
Look for slow leaks under the sink, condensation behind a refrigerator, wet rags, mop buckets, plant saucers, and standing water near a utility room. UC IPM’s property-management guidance groups pest-conducive conditions into food, water, hiding places, and entry points. UC IPM pest-prevention guidance is written for larger properties, but the same four-part scan works in a kitchen, bathroom, garage, or apartment.
Search bins, compost, pet areas, and the yard
A house fly problem can be generated outside and delivered indoors through a single open door. Inspect garbage and recycling bins for residue under the rim and at the wheels. Keep lids fully closed, bag wet food waste, and move bins as far from doors and frequently opened windows as practical. Wash and dry bins rather than relying on a fragrance product to cover the smell.
Compost needs airflow and the right balance of material, but an exposed, soggy pile beside a back door can become a fly nursery. Cover fresh food scraps with a dry carbon layer, keep the pile managed, and correct leaks or pooling water. Do not bring unfinished outdoor compost into indoor pots; BBC Gardeners’ World Magazine notes that houseplant fungus gnats are associated with damp compost and that fresh, suitable potting media is a better indoor starting point. Its fungus-gnat guide also recommends letting compost dry between waterings when the plant can tolerate it.
If the same wall or window attracts flies despite clean indoor sources, inspect roof vents, siding gaps, porch lights, nearby animal housing, a neighbor’s refuse area, and dead vegetation or carcasses. A professional can help distinguish a home-generated source from flies arriving continuously from beyond your property line.
Run a first-24-hour reset
The fastest responsible approach is not “spray everything.” It is a coordinated reset that removes the most productive source, closes the easiest entry route, and catches the adults already inside. Take a quick photo of the busiest location before cleaning so you can compare activity later.

Remove organic material and clean the source
Bag or seal the suspected material first. Do not carry an open bin, wet food scrap, or soiled litter pan through the home. Empty it into the appropriate outside container, then clean the container, surrounding floor, cabinet edge, and wall behind it. Drying is part of the treatment; flies prefer moisture, and damp cleaning cloths can preserve the very condition you are trying to remove.
For a drain, scrub the accessible film before flushing. For plant soil, correct watering rather than starving a plant that needs consistent moisture; use a soil-level sticky card for adults and repot only when the medium is infested, decomposed, or chronically waterlogged. For a compost area, improve the pile rather than pouring household insecticide onto it.
Do not mix vinegar, bleach, ammonia, drain chemicals, or insecticides. “Natural” does not mean harmless to lungs, skin, pets, plants, or finishes. If a cleaner label gives different directions from a general household tip, follow the label and ventilate as directed.
Seal entry points and change the airflow pattern
After the source is handled, inspect screens in every room where flies cluster. Patch small tears or replace damaged mesh. Check the frame-to-wall seam, the sliding track, the bottom of exterior doors, and utility penetrations. A door sweep or weatherstripping can close a gap that is invisible when the door is shut but obvious when daylight shows beneath it.
Keep exterior doors closed except when actively moving through them. If you need ventilation on a porch or at an open doorway, a box fan aimed across the opening or across a dining table can make the space less comfortable for weak-flying house flies. The fan is a barrier for the moment; it does not remove a breeding site.
Move garbage and baited outdoor traps away from doors, windows, and seating. A strong-smelling trap beside the back step can pull flies toward the house before it catches them. This placement trade-off is easy to miss: a trap should intercept traffic, not create a new attractant at the threshold.
Choose traps and mechanical controls by job
Traps are excellent for reducing adult flies and measuring whether your source work is succeeding. They are weak substitutes for sanitation. UC IPM specifically notes that sticky ribbons are useful for a few flies in confined areas but are not enough for heavy infestations or outdoor control.

Match the trap to the fly
For a few house flies indoors, use a discreet sticky strip near a window or resting area, or remove individual adults with a swatter or vacuum. Keep swatting and visible glue surfaces away from food preparation. A swatter near uncovered food can turn a nuisance into a contamination event.
For fruit flies, use an apple-cider-vinegar trap only after produce, recycling, compost, and drains have been checked. A bait trap’s effectiveness falls when a larger, fresher food source sits beside it. If you catch many flies but the count returns each morning, the source still exists.
For fungus gnats, use yellow sticky cards near the soil surface rather than hanging them in the garden. BBC Gardeners’ World Magazine cautions that outdoor sticky cards can catch butterflies and hoverflies, while soil-level placement is better matched to gnats that stay close to pots. Reduce unnecessary moisture and protect seedlings, which are more vulnerable than established plants.
For an outdoor garbage or animal-waste zone, a commercial baited bag or inverted-cone trap can help when placed well away from doors and occupied seating. The attractant may smell foul by design. Replace it when the label says to, and do not position it beside a patio chair just because that is where you see the adults.
Placement and monitoring matter more than the gadget
UV-A light traps can be useful indoors when they are not competing with bright daylight or stronger lights. Choose a glue-board model for areas where food is prepared or served rather than an open electrocution grid. A peer-reviewed review of alternative house-fly controls explains why: electrocution can fragment insects and disperse particles, making placement above food preparation especially inappropriate. The peer-reviewed house-fly control review also emphasizes that exclusion, sanitation, and source reduction remain the foundation.
Do not mount a UV trap where it is visible through an open window or exterior door; it can draw insects toward the opening. Keep it where flies already travel, follow the manufacturer’s clearance instructions, and clean or replace glue boards on schedule. A trap that is full, dusty, unplugged, or hidden behind a curtain is not evidence that the method failed.
Treat every trap as a monitoring tool. Mark the date you placed it and count catches after 24 hours, 72 hours, and one week. A falling count suggests the combined plan is working. A flat or rising count means you should revisit the source, check a neighboring room or unit, and inspect outside—not simply add a second spray.
Use sprays only when the label and the situation justify them
Insecticide can kill adult flies quickly, but it usually does not remove the garbage residue, drain film, compost pocket, or wall void where the next generation develops. UC IPM warns that pesticides are generally a last resort in residential fly management and that house flies can develop resistance to insecticides. A short-term knockdown has a place when immediate relief is necessary, but it should sit inside a source-and-exclusion plan.

If you use a product, select one labeled for the specific indoor or outdoor site and target pest. Read the entire label before opening it. Keep sprays away from food, dishes, utensils, pet bowls, children, aquariums, and food-preparation surfaces unless the label expressly permits that use. Do not spray into air-conditioning intakes, onto plants, or into a drain unless the product is specifically labeled for that location.
Never increase the concentration, mix products, or assume that a garden insecticide is suitable indoors. Remove or cover food, ventilate as directed, keep people and pets out for the labeled interval, and store the product in its original container. If you cannot meet the label conditions, use exclusion, cleaning, traps, or professional service instead.
Repellent herbs are a reasonable comfort measure but not a control program. Basil, mint, lavender, and similar strong-smelling plants may mask food odors or make a doorway less attractive for a while. Gardening Know How’s discussion of basil and flies makes the important distinction that basil does not kill flies and has limited effectiveness when pests are already on the plant. Do not let a pot of basil delay taking out the trash or repairing a screen.
Know when a persistent fly problem needs professional help
Call a qualified pest professional when flies remain numerous after a careful cleanup and exclusion effort, when you cannot find the source, or when the source may be structural. Strong warning signs include blow flies emerging from a wall or ceiling, flies appearing from a floor drain despite repeated cleaning, a suspected broken sewer line, a dead animal in an inaccessible void, or a building with multiple affected units.

Professional help is also sensible when the infestation affects a food business, childcare setting, healthcare environment, or anyone who cannot safely tolerate the cleaning or pesticide exposure. Ask for an inspection that identifies conducive conditions, breeding sites, entry routes, and a follow-up plan. A service that only fogs the visible adults may give impressive same-day relief while leaving the reason for the infestation untouched.
If you live in an apartment or shared building, document dates, locations, photos, and the result of your cleaning. Flies may be coming through a shared refuse room, plumbing chase, roof void, or neighboring unit. The CDC notes that IPM works best when residents, maintenance teams, and pest professionals address the conditions together; repeated spraying inside one unit cannot correct a building-wide source.
Prevent a repeat infestation with a small weekly routine
Once the adult count drops, prevention becomes easier if it is specific. Keep a tight lid on garbage, tie off wet food waste, rinse recyclables, and wash the inside of the can before odor and residue build up. Remove pet waste and fallen fruit frequently during warm weather. Keep compost covered and managed, and avoid storing it directly beside a door.
Run a short entry-point check every week during fly season. Look at the lower corners of screens, the door sweep, weatherstripping, garage edges, and the gap around pipes or vents. Repair small defects while they are easy. At night, turn off unnecessary exterior lights and avoid leaving a bright open window un-screened; light and indoor food odors can work together as an invitation.
For houseplants, water according to the plant’s needs rather than a fixed calendar, empty saucers, and quarantine new plants long enough to inspect their potting mix. Sticky cards can tell you whether a cloud is fungus gnats, but they will not cure saturated soil. For outdoor gardens, keep beneficial insects in the equation: the RHS identifies hoverflies as pollinators and aphid predators, so broad insecticide use can remove allies while failing to solve an indoor fly route.
Keep traps out for at least several days after activity appears to stop, then remove them and continue monitoring. If flies return after a quiet week, compare the location and type with your original notes. A changed location often means a second source; the same location suggests a missed residue, a moisture fault, or a gap that was never sealed.
Conclusion
The lasting way to get rid of flies is to stop treating the adults as the whole problem. Identify what you have, find the wet organic material or food residue that supports it, remove and dry that source, close screens and door gaps, then use a species-appropriate trap to clear the adults that remain.
Vinegar traps, herbs, sticky cards, fans, UV glue-board traps, and a carefully labeled spray can each have a narrow job. None replaces source reduction. If flies persist, appear from a wall or drain, or arrive in large numbers from a shared or inaccessible source, bring in a professional who will inspect and correct the conditions—not just knock down the insects you can see.



