How to Get Rid of Gnats Indoors with Prevention: 7 steps to stop gnats coming back

Gnats indoors are a symptom, not bad luck. They’re breeding somewhere specific – overwatered plants, gunky drains, rotting food, damp corners under appliances – and until you remove those breeding spots, prevention sprays and traps are just chasing the symptom. The good news: gnat prevention is mostly about removing the conditions they need rather than doing anything complicated. Dry it out, clean it up, and they have nowhere to live.

Remove Decaying Organic Matter

Decaying organic matter is both food and breeding ground for fungus gnats and their larvae. Eliminating it removes what’s sustaining the problem.

Outdoors, dig up old tree stumps, pull out buried wood chips, rake up thick layers of thatch, and clear decomposing mulch from garden beds. If you’ve recently had a tree removed, grind the stump and roots – don’t just cut it flush with the ground. Pet waste, fallen fruit, and heavy leaf layers all contribute.

Indoors, the sources are different: overwatered potting soil, rotting food in trash cans, food residue in drains, and damp organic debris on windowsills or under appliances. Find the source and clear it. There’s usually one main culprit, and once you find it, the infestation collapses fast.

Check for Hidden Breeding Spots

Gnats hide in places you forget to check. Common spots: pet food bags left open, birdseed, dried flowers in arrangements, old rugs in storage, forgotten boxes in the attic, overripe produce at the back of the fruit bowl, standing water in drain pans under the fridge, and damp soil in potted plants.

Do a full search of your home. Open every bag, box, and container in affected areas. Look for larvae (tiny white worms in soil or drain gunk), eggs, or signs of activity. If you find an infested item, bag it immediately and either freeze it for 48 hours at 0°F (-18°C) – which kills most insects at all life stages – or toss it straight outside.

The faster you eliminate all breeding sites, the faster you stop the cycle.

Clean Drains Regularly

Gnats lay eggs in the slimy gunk that builds up inside drains. Pour half a cup of baking soda down the drain, follow with half a cup of white vinegar, and let it fizz for 15 minutes. The reaction breaks down organic buildup where larvae hide. Finish with boiling water to flush everything out. Do this weekly in kitchen and bathroom drains.

For stubborn buildup, use a long drain brush before the baking soda and vinegar treatment. You’re scrubbing away the film gnats need to lay eggs in. The brush reaches deeper than any liquid treatment, especially in those first few inches where most gnat larvae actually live. A couple of dollars at a hardware store. Worth it.

Remove Exposed Soil Indoors

Houseplants with exposed soil are gnat magnets. Cover the soil surface with a half inch of sand or aquarium gravel. Gnats can’t get through it to lay eggs, but water still drains fine.

Also let the top two inches of soil dry out completely between waterings. Gnat larvae die without constant moisture. Most houseplants are actually overwatered anyway, so this is good for the plant too. Two birds, one stone.

Eliminate Standing Water

Standing water is a reliable attractor for gnats and other flying insects. Buckets, clogged gutters, birdbaths, and tarps holding rainwater all contribute to the population outside – and those insects migrate indoors.

Empty anything holding water. Clean gutters twice a year minimum. If you have a birdbath, change the water every few days. Fix leaky outdoor faucets. Walk your yard after it rains and dump out whatever collected. Fewer insects outside means fewer getting in.

Wipe Up Moisture

After cooking or washing dishes, wipe down counters and sinks completely. Don’t leave wet sponges sitting out. Gnats will find a damp sponge and treat it like prime real estate. Squeegee your shower walls after use if you’re dealing with a persistent bathroom problem.

Gnats are small and opportunistic. They don’t need a flood – a wet sponge is enough. Removing surface moisture is one of the fastest ways to make your kitchen inhospitable to them.

Take Out Trash Regularly

Your kitchen trash is a feeding and breeding ground. Food scraps, rotting organic matter, and spilled liquids attract gnats and give them a reason to stay.

Take trash out every day or two, more often during warm months. As soon as you bag up contaminated food or cleaning debris, take it outside to your outdoor bin. Double-bag heavily infested materials to prevent escapees during transport. The goal is removing the food source entirely, not just moving it to another room.