How to Get Rid of Gnats in Houseplants: 7 Proven Methods

How to Get Rid of Gnats in Houseplants: 7 Proven Methods

Seven proven, step-by-step methods to eliminate gnats from your houseplants, from hydrogen peroxide drenches to beneficial nematodes.

10 min read · Updated 2026-04-20

By PlantFix Editorial Team · Sources: University Extension Programs, USDA, EPA

First: Identify What Type of Gnat You Have

Before you start treatment, it is important to confirm that you are actually dealing with fungus gnats rather than another type of small fly. Fungus gnats are the most common pest found around houseplant soil, but fruit flies, drain flies, and shore flies can also appear indoors, and each requires a different approach.

Fungus gnats are small (about 1/8 inch), dark-bodied flies with long legs and antennae. They hover around the soil surface of your plants and fly in short, erratic patterns. They are weak fliers and tend to stay close to the soil rather than zooming around the room. When you water a plant or disturb the soil, you will often see several take flight.

Fruit flies are slightly larger, tan or brownish with distinctive red eyes. They cluster around ripe fruit, garbage cans, drains, and recycling bins rather than plant soil. If the flies are mostly in your kitchen away from plants, you probably have fruit flies.

Drain flies (also called moth flies) are fuzzy, moth-like flies that emerge from drain pipes, especially in bathrooms. Shore flies look similar to fungus gnats but are stockier with shorter antennae and are typically found in very wet, algae-covered soil. The treatments described in this guide are specifically for fungus gnats, though several methods will also help with shore flies.

Method 1: Hydrogen Peroxide Soil Drench

This is one of the fastest and most accessible methods. Mix one part standard 3% hydrogen peroxide (the kind sold at any pharmacy) with four parts water. Wait until the soil has dried out somewhat, then water your plant thoroughly with this mixture as you would normally water.

When the hydrogen peroxide contacts the moist soil, it fizzes and releases oxygen. This effervescent action kills fungus gnat larvae and eggs on contact without harming plant roots. In fact, the extra oxygen can actually benefit root health. The hydrogen peroxide breaks down into water and oxygen within minutes, leaving no residue.

Repeat this treatment every time you water for two to three weeks. This ensures you catch larvae at every stage of development, since eggs take about 4 to 6 days to hatch. One or two treatments may provide visible relief, but stopping too early allows surviving eggs to hatch and restart the cycle.

This method is safe for virtually all houseplants, including sensitive species and edible herbs. It is also safe around pets and children. The main limitation is that it only works on contact, so it must reach the larvae in the soil. Water thoroughly enough for the solution to penetrate the top two to three inches where larvae live.

Method 2: Yellow Sticky Traps

Yellow sticky traps are an essential part of any gnat control strategy because they capture adult flies, breaking the reproductive cycle. Fungus gnats are strongly attracted to the color yellow and will land on the adhesive surface and become stuck.

Place the traps horizontally at soil level or insert them into the soil using the included stakes. This positioning is crucial because fungus gnats spend most of their time near the soil surface. Traps hung high on a plant or placed on a windowsill will catch far fewer gnats.

Check and replace the traps every three to five days, or sooner if they become covered with insects. The traps also serve as an excellent monitoring tool: count the gnats caught each day to track whether your treatments are working. You should see the catch rate drop steadily over two to three weeks with consistent treatment.

For a DIY alternative, you can coat small pieces of yellow card stock or index cards with petroleum jelly or a thin layer of honey. These homemade traps are less effective than commercial ones but can work in a pinch. Place several traps around each affected plant for best results, especially near the soil surface and any nearby windows.

Method 3: BTI (Mosquito Bits or Mosquito Dunks)

BTI stands for Bacillus thuringiensis subspecies israelensis, a naturally occurring soil bacterium that produces proteins toxic specifically to the larvae of fungus gnats, mosquitoes, and black flies. It is harmless to plants, humans, pets, earthworms, and beneficial insects. Many experienced plant owners consider BTI the gold standard for fungus gnat control.

Mosquito Bits are small granules that release BTI quickly. To use them, add about 4 tablespoons of granules to a gallon of water and let it soak for at least 30 minutes (overnight is better). Strain out the granules and use the treated water to water your plants. The BTI in the water will kill any larvae it contacts in the soil. You can also sprinkle the granules directly on the soil surface, where they will release BTI each time you water.

Mosquito Dunks are larger, donut-shaped tablets that release BTI more slowly over 30 days. Break a dunk into quarters and drop a piece into your watering can, refilling the can with water as needed. This provides a continuous supply of BTI-treated water.

Apply BTI-treated water with every watering for at least four weeks to ensure complete control. Because BTI is a biological agent that breaks down in sunlight and soil over time, consistent reapplication is important. It does not build up in the soil or harm the soil microbiome.

Method 4: Sand or Gravel Top Layer

Adding a half-inch to one-inch layer of coarse sand, fine gravel, perlite, or decorative pebbles on top of the soil creates a physical barrier that prevents adult fungus gnats from reaching the moist soil to lay eggs. It also makes the top layer of the growing medium inhospitable to larvae.

Use horticultural sand, builder's sand, or coarse sand rather than fine play sand. Fine sand can compact and impede water penetration. Perlite is another excellent choice because it is lightweight and improves drainage. Decorative gravel or small pebbles work well too and can enhance the appearance of your pots.

This method works best as a complement to other treatments rather than a standalone solution. If larvae are already present in the soil, a sand layer will not kill them. It will, however, prevent new eggs from being laid, so combining a sand layer with a hydrogen peroxide or BTI drench gives you both immediate larval kill and long-term prevention.

One important consideration is watering. With a sand or gravel layer, it becomes harder to gauge soil moisture by looking at the surface. You will need to use your finger, a moisture meter, or the weight of the pot to determine when to water. The barrier itself does not significantly affect how water reaches the roots, as it drains through sand and perlite easily.

Method 5: Let the Soil Dry Out

The simplest method, and the foundation of all other treatments, is to let the soil dry out between waterings. Fungus gnat larvae need consistently moist soil to survive. When the top one to two inches of soil are dry, larvae desiccate and die, and adult females will not lay eggs in dry conditions.

For most houseplants, allowing the top inch of soil to dry between waterings is perfectly healthy and in many cases is actually the recommended watering practice. Tropical plants that prefer consistently moist soil (like ferns and calatheas) may not tolerate extended dry periods, but even these plants can handle the top half inch of soil drying slightly.

To speed up the drying process, increase air circulation around your plants. A small fan on a low setting pointed near (not directly at) your plants will significantly speed up surface evaporation. Moving plants to a brighter location can also help, as light and warmth increase evaporation rates.

Bottom watering is a useful technique during a gnat infestation. Instead of watering from the top, place the pot in a tray of water and let the soil absorb moisture from below for 20 to 30 minutes. This keeps the top layer of soil dry while still delivering water to the roots. Remove the pot from the tray when the top of the soil feels damp, and do not leave it sitting in water indefinitely.

Method 6: Neem Oil Soil Drench

Neem oil can be used as a soil drench to target fungus gnat larvae. Mix 1 to 2 tablespoons of cold-pressed neem oil with 1 teaspoon of mild liquid castile soap and one gallon of warm water. Stir or shake thoroughly until emulsified, then water your plants with this solution.

The azadirachtin in neem oil disrupts the larvae's ability to feed and molt, effectively stopping their development. It also has a repellent effect on adult females, discouraging them from laying eggs in treated soil. Unlike hydrogen peroxide, which kills on contact and breaks down immediately, neem oil provides residual activity in the soil for several days.

Apply the neem drench every 7 to 10 days for three to four weeks. On the weeks between neem treatments, you can alternate with hydrogen peroxide drenches for a particularly aggressive approach. This one-two punch addresses larvae through two different mechanisms and tends to produce faster results than either method alone.

Neem oil soil drenches are safe for most houseplants, but test on a small area first if you have sensitive species. Do not use neem drenches on plants that are severely dehydrated or heat-stressed. Water the plant lightly with plain water the day before treatment so the roots are hydrated and resilient.

Method 7: Beneficial Nematodes

Beneficial nematodes, specifically Steinernema feltiae, are microscopic roundworms that actively hunt and kill fungus gnat larvae in the soil. They are a biological control agent used by commercial greenhouses and are increasingly available to home gardeners.

Nematodes are sold as a powder or on a sponge and must be mixed with water and applied as a soil drench. Follow the product instructions for mixing ratios, as concentrations vary by brand. Apply the nematode solution to pre-moistened soil (water the plant an hour before application) and keep the soil consistently moist for two to three days after application. Nematodes need moisture to move through the soil and find their prey.

Once they locate a fungus gnat larva, the nematodes enter the larva's body and release bacteria that kill it within 24 to 48 hours. The nematodes then reproduce inside the dead larva, releasing a new generation that continues to hunt remaining larvae. A single application can provide control for several weeks.

The main requirements for success are proper storage and handling. Nematodes are living organisms that must be kept refrigerated (not frozen) until use and should be applied within a few weeks of purchase. Apply them in the evening or on a cloudy day because UV light kills them quickly. Once they are in the soil, they are protected from light and can survive for weeks.

Beneficial nematodes are completely safe for plants, pets, children, and earthworms. They target only specific insect larvae and do not establish permanently in indoor potting soil, so reapplication every four to six weeks may be needed for ongoing prevention.

When to Use Each Method

For a mild infestation with just a few gnats, start with the easiest methods: let the soil dry out, set up yellow sticky traps, and apply one hydrogen peroxide drench. This is often enough to resolve a minor problem within two weeks.

For a moderate infestation where you see gnats every day, combine three methods: yellow sticky traps for adults, BTI or hydrogen peroxide drenches for larvae, and a sand or perlite top layer to prevent new eggs. Maintain this regimen for three to four weeks.

For a severe infestation with clouds of gnats and visible larvae in the soil, deploy the full arsenal. Start with a hydrogen peroxide drench to get immediate larval kill, switch to BTI for ongoing biological control, add sticky traps and a sand layer, and consider nematodes for the most persistent cases. In severe situations, you may also want to unpot the plant, remove as much old soil as possible, and repot in fresh, sterile mix.

Regardless of the severity, the critical success factor is consistency. Gnats reproduce quickly, and skipping even one treatment cycle can allow the population to rebound. Commit to at least three weeks of consistent treatment before declaring victory.

Recommended Products

Mosquito Bits (BTI Granules)

Quick-release BTI granules that kill fungus gnat larvae within 24 hours of application. Soak in water and use as a soil drench, or sprinkle on soil and water in. The most reliable biological control available.

$8-$15 · Best for The single most effective long-term larval treatment

3% Hydrogen Peroxide (32 oz)

Standard pharmacy-grade hydrogen peroxide. Dilute 1:4 with water for an immediate-action soil drench that kills larvae and eggs on contact. Breaks down into water and oxygen with no residue. Available at any drugstore.

$2-$5 · Best for Cheapest and fastest initial treatment for active infestations

Beneficial Nematodes (Steinernema feltiae)

Live microscopic nematodes that actively hunt and kill fungus gnat larvae in the soil. Apply as a soil drench to pre-moistened soil. Must be refrigerated until use. Each packet treats multiple plants.

$15-$30 · Best for Persistent infestations that have not responded to other methods

FAQ

What is the fastest way to get rid of gnats in houseplants?

The fastest visible reduction comes from combining yellow sticky traps (which catch adults immediately) with a hydrogen peroxide soil drench (which kills larvae on contact). You can see a major decrease in adult gnats within 48 hours using this combination. However, complete elimination still takes two to three weeks of consistent treatment to break the entire lifecycle.

Will vinegar traps work for fungus gnats?

Apple cider vinegar traps are effective for fruit flies but much less effective for fungus gnats. Fungus gnats are attracted to moist soil and decaying organic matter rather than fermented fruit. If vinegar traps are catching flies near your plants, you may actually have fruit flies rather than fungus gnats. For fungus gnats, yellow sticky traps are a much better choice.

Can gnats in houseplants spread to other plants?

Yes, absolutely. Adult fungus gnats can fly to any nearby plant and lay eggs in its soil. A single infested plant in a room can lead to gnats colonizing every other plant within a few weeks. This is why it is important to treat all plants in the affected area, not just the one where you first noticed the problem. Isolating new plants before introducing them to your collection also helps prevent spread.

Is hydrogen peroxide safe for all plants?

A diluted hydrogen peroxide solution (1 part 3% hydrogen peroxide to 4 parts water) is safe for virtually all houseplants, including delicate species, seedlings, and edible herbs. It breaks down into water and oxygen within minutes, leaving no residue. Some gardeners use it regularly as a root health treatment even when pests are not present. Just be sure to use standard 3% hydrogen peroxide, not the stronger concentrations sold for hair bleaching or industrial use.

Related

Not sure what's wrong?

Use the diagnosis tool →

Get seasonal plant care reminders and pest alerts.