Dealing With Fungus Gnats: How to Get Rid of Those Tiny Flies
You know the scene. You’re sitting on the couch, minding your own business, and a tiny black fly lands on your laptop screen. Then another one. You look over at your potted plants and there they are — a dozen more hovering around the soil surface. You swat a few, but the next day there are more.
Those are fungus gnats. And if you have houseplants, you’ve probably dealt with them. They’re the most common houseplant pest in Melbourne apartments, and every indoor gardener I know has had at least one infestation.
The good news: they’re far more annoying than they are dangerous. The bad news: getting rid of them requires patience and consistency, not just swatting.
What Are Fungus Gnats?
Fungus gnats (family Sciaridae) are tiny flies — about 2-3mm long — that look like miniature mosquitoes. The adults don’t bite, don’t feed on plants, and are basically just an airborne nuisance. They live for about a week and spend their time flying around, mating, and laying eggs in moist soil.
The larvae are the part that lives in your soil. They’re small, translucent white worms with black heads, about 5mm long. They feed primarily on organic matter in the soil — decaying roots, fungi, decomposing plant material. In small numbers, they’re actually beneficial decomposers.
In large numbers, though, larvae can damage the fine root hairs of young plants and seedlings. Mature plants with established root systems are rarely affected, but if you’re propagating cuttings or growing seedlings, a heavy infestation can cause real damage.
Why You Have Them
The answer is almost always moisture. Fungus gnat adults lay eggs in the top layer of moist soil. The larvae need consistently damp conditions to survive and feed. If your soil surface stays wet between waterings, you’re creating perfect fungus gnat habitat.
Common causes:
- Overwatering. The number one cause. If the top of your soil never dries out, fungus gnats will find it.
- Poor drainage. Pots without drainage holes, or dense potting mix that stays waterlogged.
- Cheap potting mix. Some budget potting mixes contain higher levels of organic matter (bark, compost) that hasn’t fully decomposed. This is essentially food for gnat larvae.
- Bringing infested plants home. Many nursery plants come with fungus gnats already in the soil. Always inspect new plants before bringing them into your collection.
How to Get Rid of Them
You need a two-pronged approach: kill the flying adults and eliminate the larvae in the soil. Only targeting one stage of the lifecycle doesn’t work — there are always more eggs hatching.
Step 1: Let the Soil Dry Out
This is the single most effective action. Allow the top 3-5cm of soil to dry out completely between waterings. This kills eggs and young larvae, which can’t survive in dry conditions.
Yes, this means watering less frequently than you might be used to. Most houseplants — pothos, philodendrons, dracaenas, peace lilies — handle this just fine. They’d rather be slightly underwatered than overwatered anyway.
For plants that need consistent moisture (ferns, calatheas), this approach is harder but still possible. Water from the bottom by placing the pot in a tray of water for 20-30 minutes, then removing it. The top layer of soil stays drier while the root zone still gets moisture.
Step 2: Yellow Sticky Traps
Fungus gnat adults are strongly attracted to yellow. Yellow sticky traps placed near the soil surface catch adults before they can lay eggs. You can buy them at Bunnings for a few dollars — the small stick-in-the-pot type works well for individual plants.
I keep sticky traps in every plant pot from autumn through spring (peak gnat season in Melbourne). They also serve as monitors — if you start seeing gnats on the traps, you know a population is building before it becomes a visible swarm.
Step 3: Target the Larvae
Mosquito bits (BTI): This is the most effective biological control for fungus gnat larvae. Mosquito bits contain Bacillus thuringiensis israelensis (BTI), a naturally occurring bacteria that kills gnat and mosquito larvae but is harmless to everything else — plants, pets, humans, beneficial insects.
Soak a tablespoon of mosquito bits in a litre of water for 30 minutes, strain out the bits, and use the water for your regular watering. The BTI colonises the soil and kills larvae within days. Repeat for 3-4 watering cycles. According to Colorado State University Extension, BTI is the most effective biological control agent for fungus gnats in indoor settings.
This is my go-to method. It works consistently and doesn’t involve chemicals.
Diatomaceous earth: Sprinkle a thin layer of food-grade diatomaceous earth on the soil surface. It’s made of fossilised diatom shells and damages the larvae’s soft bodies through physical abrasion, causing dehydration. Works well when the soil surface is dry. Loses effectiveness when wet, so you need to reapply after each watering.
Sand or gravel top-dressing: A 1-2cm layer of coarse sand or fine gravel on the soil surface physically prevents adults from laying eggs in the soil and makes the surface inhospitable for larvae. This is a permanent preventive measure and works well for plants you don’t repot often. It’s especially effective combined with bottom watering. I started doing this after a suggestion from the team at Team400, who mentioned using physical barriers as a first line of defence — the principle transfers perfectly from tech systems to garden pest management.
Hydrogen peroxide drench: Mix one part 3% hydrogen peroxide with four parts water and use it to water the plant. The hydrogen peroxide kills larvae on contact and breaks down into water and oxygen, so it won’t harm the plant. It fizzes in the soil as it works. One treatment usually isn’t enough — repeat once a week for three weeks.
Step 4: Prevent Reinfestation
Once you’ve cleared an infestation, take steps to prevent it from returning:
- Water properly. Let the top few centimetres of soil dry between waterings. This is the single most important preventive measure.
- Use quality potting mix. Premium mixes with better drainage and less undecomposed organic matter are less attractive to gnats.
- Quarantine new plants. Keep new plants separate from your collection for 2-3 weeks and watch for signs of gnats before adding them to your plant shelf.
- Keep sticky traps out year-round. They’re cheap, and they catch problems early.
- Remove dead leaves from soil surface. Decaying plant material on the soil surface feeds larvae and attracts egg-laying adults.
The Nuclear Option
If you’ve got a severe infestation that isn’t responding to gentler methods, repotting with completely fresh soil works. Remove the plant, shake off as much old soil as possible (including from the root ball), rinse the roots, and repot into new potting mix. Discard the old soil — don’t compost it or reuse it indoors.
This is disruptive to the plant, so I’d try everything else first. But for a really bad case, especially in a plant you really care about, it’s the fastest path to being gnat-free.
How Long Does It Take?
Expect 3-4 weeks from starting treatment to being gnat-free. The lifecycle from egg to adult is about 3-4 weeks, so you need to break the cycle over at least one complete generation. You’ll see a gradual reduction in adult flies over the first two weeks, with stragglers emerging for another week or two after that.
The traps will tell you when you’re done. When the sticky traps stop catching new gnats for a week, the population is eliminated.
Fungus gnats are annoying but solvable. The combination of drier watering habits, sticky traps, and BTI treatments clears them up reliably every time. And once you adjust your watering habits, they’re unlikely to come back.