Knowing how to get rid of gnats starts with working out which gnats you actually have. “Gnat” is a catch-all word for small flying insects, and in UK homes it usually means fungus gnats around houseplants, fruit flies in the kitchen or drain flies around sinks. Each one breeds in a different place, so the fix is different too. This guide helps you identify them and remove the breeding source, which matters far more than swatting the adults.

Which type of gnat do you have?
Treating the wrong insect is the most common reason gnats keep coming back. Use this quick comparison before you buy anything.
| Type | Where you see it | What it looks like | Main fix |
|---|---|---|---|
| Fungus gnats (sciarid flies) | Houseplants, seed trays, damp compost | Dark greyish-brown, mostly 3 to 4 mm, running over the compost surface (RHS) | Dry out the compost, use fresh compost, sticky traps |
| Fruit flies | Kitchen, fruit bowl, bins, spilt drinks | Small flies hovering around ripe or fermenting food | Remove food sources, clean drains, use traps |
| Drain flies (moth flies) | Sinks, shower drains, bathrooms | Fatter and fluffier, clustering around drains (Rentokil) | Scrub and clear the drain |
How to get rid of fungus gnats in houseplants
The Royal Horticultural Society says fungus gnats thrive in damp compost, especially in houseplant pots and seed trays. They can breed all year indoors. Eggs hatch within a few days in warm conditions and the full life cycle takes about a month in summer, so expect to work at this for several weeks rather than a few days.
- Water less often. Constantly wet compost lets the larvae thrive. Check the compost with a finger and let the top layer dry between waterings, as long as the plant stays healthy. Never leave a pot standing in water.
- Use the right compost. The RHS says potting mixes made for houseplants are the best choice and may help avoid large numbers. When you repot, use fresh compost and throw the old compost away rather than reusing it, which removes eggs and larvae.
- Add a dry top layer. Love the Garden suggests a thick layer of fine grit over the compost to stop females laying eggs. Treat this as a practical tip rather than an RHS recommendation.
- Use yellow sticky traps. Place them close to the plants to catch adults. The RHS warns that these traps can also catch many other insects, including predators, so use them sparingly and mainly indoors.
- Consider biological control. Nematodes (Steinernema feltiae) and predatory mites are sometimes sold by mail order for use in compost. The RHS notes that they can affect other invertebrates, so read the instructions carefully.
- Quarantine new plants. Keep a newly bought plant in a separate room for a couple of weeks to see whether gnats appear before it joins the rest.
The RHS adds that fungus gnats are really only a concern when they damage seedlings or soft cuttings. Established plants are unlikely to be harmed, although the adults are a nuisance indoors. If you start seeds on a windowsill, our guide to growing lettuce explains how to keep compost evenly moist without overwatering.
How to get rid of fruit flies in the kitchen
The British Pest Control Association, quoted by Which?, stresses that fruit flies need a breeding source, so spraying or trapping alone rarely solves the problem. Work through these steps:
- Find the source. Check for ripe fruit, vegetable peelings, drink residue, damp cloths and anything fermenting in bins or under appliances.
- Clean the drains. Pest controllers repeatedly point to kitchen drains, where a layer of grease and organic film builds up and gives females somewhere to lay eggs.
- Store fruit sensibly. Keep ripe fruit in the fridge or in a sealed container for a few weeks while you deal with the problem.
- Empty and rinse the bin. Use a lidded bin and take rubbish out daily until the flies stop appearing.
- Use traps as a back-up. Yellow sticky traps catch adults, and the BPCA mentions lures such as cider vinegar in funnel traps. Traps reduce numbers but do not remove the source.
If the flies look bigger and more like regular house flies, see our separate guide on how to get rid of flies.

How to get rid of drain flies
Drain flies breed in the slimy film that collects inside pipes and U-bends. Clearing it is the whole job. Remove the plug or strainer, scrub the visible pipe with a bottle brush, and rinse with hot tap water. For a slow or smelly drain, follow the steps in our guide on how to unclog a slow drain. Repeat the clean every few days for a couple of weeks, because eggs and larvae in the pipe will otherwise keep producing adults.
More in Home
Prevention checklist
- Wipe worktops and sink areas dry each evening.
- Rinse bottles and cans before recycling them.
- Do not let compost, potting mix or houseplant saucers stay soggy.
- Clean kitchen and bathroom drains regularly.
- Close the bin lid and take rubbish out often in warm weather.
- Check new plants and bags of compost for gnats before bringing them inside.
When to call a professional
If you have cleared every likely breeding source and still see large numbers after three or four weeks, or you cannot tell what you are dealing with, a pest controller can identify the species and find the source. Rentokil points out that accurate identification is crucial because treatments for fruit flies and drain flies differ.
FAQ
Are gnats harmful?
Fungus gnats are mainly a nuisance indoors, according to the RHS, and rarely harm established plants. Fruit flies are not dangerous in the usual sense, but you should keep them away from food preparation areas.
How long does it take to get rid of gnats?
Because a fungus gnat life cycle can take about a month in summer, plan on several weeks of consistent action. Removing the breeding source speeds things up considerably.
Do sticky traps get rid of gnats on their own?
They catch adults and help you see how bad the problem is, but they do not stop new ones hatching. Combine them with drier compost, fresh compost or drain cleaning.
Why do I have gnats in winter?
Houseplants and heated homes give gnats the warmth and damp compost they need, and the RHS says they can breed all year round indoors.
Can I stop gnats coming back?
Yes, by keeping compost on the dry side, cleaning drains and not leaving ripe food or drink residue out. These habits matter more than any spray.




