How to keep flies away from your houseplants for good — try these 7 expert tips
Flies buzzing around your houseplants? Here's how to get rid of them

Nothing ruins the joy of indoor gardening quite like clouds of tiny flies buzzing around your beautiful plants.
You've carefully chosen houseplants to brighten your living space, only to discover they've become a breeding ground for annoying insects that seem impossible to eliminate.
Those small dark flies hovering around your plant pots aren't just a minor nuisance, they're most likely fungus gnats, and they can actually harm your plants if left unchecked.
According to gardening expert Calum Maddock at HomeHow.co.uk, "These flies are drawn to moist soil and decaying organic matter – precisely the conditions found in most of your houseplants."
The problem usually starts innocently enough with slightly overwatered soil, but quickly escalates into a full-blown infestation.
Fortunately, these common plant pests are predictable in their behavior, which means you can take targeted action to eliminate them and prevent future invasions. Here's how you can keep these annoying flies away for good.
1. Keep the top layer of soil dry
Moisture control is your first line of defense against fungus gnats. "Fungus gnats, as their name suggests, are enticed by moist and wet environments," explains Maddock.
"By keeping the top couple of inches of your plant's soil dry, the conditions will not be conducive to the flies." This simple change removes the ideal breeding environment that attracts these pests in the first place.
Allow the soil surface to dry out between waterings, but make sure your specific plants can tolerate this approach.
Most houseplants actually prefer their soil to dry slightly between waterings, so this method works well for popular varieties like pothos, snake plants, and rubber trees.
2. Water plants from the bottom instead
Bottom watering keeps the soil surface dry while still providing plants with the moisture they need. Place your plant pot in a saucer or container filled with water and let it sit for 20-30 minutes.
The plant will absorb water through the drainage holes, keeping roots hydrated while leaving the top layer of soil dry and uninviting to flies. Remove any excess water that hasn't been absorbed to prevent root rot.
This method works particularly well for plants that don't like water on their leaves and provides more even moisture distribution throughout the soil.
It also prevents the constant surface moisture that fungus gnats need for egg laying and larval development.
3. Create a physical barrier with gravel or pebbles
Adding a layer of decorative stones, gravel, or pebbles on top of your soil creates an effective barrier against egg-laying flies.
"As the surface is covered by the gravel, horticultural grit or pebbles, the flies are unable to gain access to the soil to lay their eggs," notes Maddock. "This disrupts their reproduction cycle and reduces the number of flies around your houseplants."
Use about half an inch of material to cover the entire soil surface. This method also adds an attractive decorative element to your plants while serving a practical purpose.
The barrier prevents flies from reaching the soil while still allowing water and air to reach the plant roots.
4. Set up sticky traps to catch adult flies
Yellow sticky traps are highly effective at catching adult fungus gnats before they can reproduce.
"The bright yellow colour lures the flies onto the paper as it looks like a flower," explains Maddock. "Once they land on the perpetually sticky surface, the adhesive holds and immobilises them."
Place these traps horizontally near your plants for maximum effectiveness, as flies are more likely to land on flat surfaces.
These traps work best as part of a comprehensive approach, catching adult flies while you address the root causes of the infestation. Replace them when they become covered with insects or lose their stickiness.
These bright yellow sticky traps work like fungus gnat magnets. The adults can't resist flying straight into them and getting permanently stuck. They pair perfectly with mosquito dunks since the dunks kill larvae in the soil while these traps catch any stragglers still flying around.
5. Use homemade vinegar traps
Create effective DIY traps using common household items. "A mixture of water, cider vinegar and washing up liquid in a jar is an effective method of attracting and trapping flies," says Maddock.
"The smell of the cider vinegar draws them in, and they enter the jar. However, the washing-up liquid breaks the surface tension of the liquid, so when the flies land on it, they fall into the mixture and drown."
Mix equal parts water and apple cider vinegar in a small jar, add a few drops of dish soap, and place it near affected plants.
The vinegar's fermented smell attracts the flies, while the soap ensures they can't escape once they land on the surface. Replace the mixture every few days for continued effectiveness.
6. Apply diatomaceous earth as a natural deterrent
Food-grade diatomaceous earth provides a safe, natural solution for controlling fungus gnats. This powder, made from fossilized microscopic organisms, has a texture that damages the exoskeleton of flies, causing them to dehydrate.
Sprinkle a thin layer over the soil surface, being careful to use only food-grade diatomaceous earth, which is safe around people and pets.
Reapply after watering, as the powder loses effectiveness when wet. While this method takes longer to show results than traps, it provides ongoing protection against both adult flies and larvae that come into contact with the treated soil surface.
This 4lbs pack of diatomaceous earth is an organic way to control pests in your garden. The fine powder containing fossilized marine organisms can be used around outdoor plants to deter pests.
7. Consider repotting severely infested plants
For serious infestations, sometimes the most effective solution is starting fresh. "If your plant has a serious infestation of sciarid flies, it may be worth repotting it rather than trying to rescue the current soil," advises Maddock.
Remove the plant from its current soil, gently wash the roots to remove any larvae, and replant in fresh potting mix.
Dispose of the old soil in your outdoor compost rather than indoor trash to prevent flies from spreading. After repotting, implement preventive measures like bottom watering and surface barriers to avoid reinfestations. This method works particularly well for valuable plants or when other control methods haven't been successful.
As Maddock concludes, "While these methods are useful and, of course, can be combined to provide even better results, there is no guarantee that they will eliminate all the flies around your houseplants.
However, the information given here lets you choose one or more methods which can allow you to better manage the problem."
More from Tom's Guide
- Discover how to tell if you're overwatering your houseplants
- And 5 houseplants that will help prevent mold in your home
- Plus, how to spot a thirsty houseplant: 7 telltale signs
Get instant access to breaking news, the hottest reviews, great deals and helpful tips.

Kaycee is Tom's Guide's How-To Editor, known for tutorials that skip the fluff and get straight to what works. She writes across AI, homes, phones, and everything in between — because life doesn't stick to categories and neither should good advice. With years of experience in tech and content creation, she's built her reputation on turning complicated subjects into straightforward solutions. Kaycee is also an award-winning poet and co-editor at Fox and Star Books. Her debut collection is published by Bloodaxe, with a second book in the works.
You must confirm your public display name before commenting
Please logout and then login again, you will then be prompted to enter your display name.