Learning how to get rid of gnats in the house starts with finding where they breed. Remove overripe produce, clean wet organic buildup, or correct damp plant soil before reaching for a spray. Small flying insects are often grouped together as “gnats,” but the right fix depends on which area attracts them.
Quick answer: Find where the flies gather, remove the damp or decaying material supporting them, and monitor the area for one to two weeks. Traps can catch adults, but they won’t stop new flies if eggs and larvae remain.
First, identify where the gnats are coming from
You usually don’t need to identify an exact species immediately. Start by noting where the insects consistently appear.
- Around fruit, recycling, or trash: Fruit flies are small, tan to brown flies commonly associated with fermenting produce, drink residue, and food waste.
- Near sinks, showers, or floor drains: Drain flies have broad, fuzzy wings and often rest on walls near plumbing. Their larvae develop in the moist organic film inside drains or other wet areas.
- Around houseplants: Fungus gnats are dark, delicate flies with long legs. Adults often walk across potting soil or rise when a plant is moved.
- Near a sewage smell, damaged pipe, or wall opening: Small flies may be breeding in a plumbing leak or another hidden wet area. This calls for closer inspection rather than surface spraying.
If the insects bite, they may not be fruit flies, drain flies, or fungus gnats. Avoid identifying an unfamiliar pest from a skin reaction alone.
How to get rid of gnats in the house by removing the source
1. Clear food and drink residue
Discard spoiled produce and refrigerate ripe fruit while the problem is active. Rinse cans and bottles before placing them in recycling, empty the trash regularly, and wipe residue from counters, appliance edges, and the bottoms of containers.
Check less obvious places, including a forgotten onion or potato, spills beneath a trash liner, mop buckets, and reusable drink containers. A small amount of fermenting material can support repeated fruit fly activity.
A cup trap containing vinegar and a small amount of dish soap may catch adult fruit flies. Use it only as a monitoring and cleanup aid. Keep it where children and pets cannot drink or spill it, and continue searching for the breeding source.
2. Clean drains mechanically
If flies gather around a drain, scrub the inside surfaces you can safely reach with a long, stiff drain brush. The goal is to remove the slimy organic film where larvae can develop, not simply to send liquid down the pipe.
Clean the drain opening, stopper, overflow opening, and removable strainer where appropriate. Fix slow drainage and leaks rather than repeatedly pouring cleaners into the drain.
Do not mix bleach, ammonia, drain openers, or other household chemicals. Dangerous gases or reactions can result. Avoid pouring boiling water where it could splash or damage plumbing. If you use a drain-cleaning product, follow its complete label and plumbing instructions.
3. Adjust houseplant care
Let the upper layer of potting mix dry between waterings when the plant can tolerate it. Empty water from saucers, remove fallen leaves, and make sure pots drain properly. Constantly damp soil favors fungus gnat larvae.
Yellow sticky cards placed close to the soil can help you track and reduce adult fungus gnats. Keep them away from children, pets, and places where they could catch small wildlife. Cards won’t control larvae already living in the potting mix.
For a severe plant-centered problem, replacing waterlogged potting mix may help. Inspect roots and choose a clean container with suitable drainage. Follow the care requirements for the plant rather than allowing a moisture-sensitive plant to become dangerously dry.
Skip indoor foggers and broad spraying
Spraying the adults you see rarely solves a gnat problem because more can emerge from the breeding material. Foggers and broad indoor treatments also expose more surfaces without correcting the moisture, food residue, or plumbing issue.
If you consider a pesticide, first confirm the type of fly and its breeding location. Use only a product whose current label lists that pest and the specific indoor location. Follow every label direction concerning placement, ventilation, food surfaces, children, pets, storage, and disposal.
Monitor after cleanup
Place simple monitoring traps near the suspected source, not throughout the entire house. Note whether catches decline and watch for the area where fresh adults continue appearing.
Adult flies may remain for several days after you remove the source. A steady decline is a good sign. Continued activity usually means that some breeding material was missed, moisture remains, or flies are coming from another location.
When the problem needs professional help
Ask a licensed pest professional or qualified plumber for help when:
- flies continue for more than one or two weeks after thorough source removal;
- large numbers emerge from a wall, cabinet void, floor drain, or other place you cannot reach;
- you notice sewage odors, recurring backups, leaking pipes, or water-damaged building materials;
- several apartments or shared drains appear affected; or
- you cannot confidently distinguish the insects from biting or higher-risk pests.
Renters should report suspected plumbing leaks, sewage problems, and activity involving shared building systems to the property manager. Until the source is corrected, keep food covered, reduce moisture, and monitor the most active area rather than treating the whole home.

