Key takeaways
- White maggots up to about 8mm long tunnel into onion roots and bulbs
- Young plants that wilt and pull up easily in May or June are the classic sign
- Fine insect mesh or fleece, put on at planting, is the best defence
- Onion sets suffer less than seed-sown onions, which need thinning
- Lift and bin affected plants, maggots and all, and move onions to a new bed each year
Onion root fly (also called onion fly) is a small grey fly whose maggots eat onion roots and bulbs from the inside. Young plants turn yellow, wilt and die, mostly in May and June. The best defence is simple: cover your onions with fine insect mesh at planting, and grow from sets.
It also attacks shallots, leeks and garlic. This guide shows you how to recognise the damage and the five defences that keep it out. For other onion troubles, the guide to onion diseases helps you rule things out.
How to spot onion root fly damage
The first sign is yellowing leaves, then the whole plant wilts even in damp soil. Young plants flop over and die. Bigger plants may survive but the bulb rots.
Pull up a sick plant. It often comes away easily, because the roots have been eaten. Look for small white maggots, up to about 8mm long, in the root plate or tunnelling into the bulb. The bulb is soft and smells of rotting onion.
The adult fly is grey and looks like a small housefly. You rarely notice the flies themselves. The damage is what gives them away.

A soft, tunnelled base with small white maggots nearby is the giveaway. Healthy plants either side stand firm.
Onion fly or something else?
Several onion problems cause yellow, sickly plants. Here’s how to tell them apart:
| Problem | What you find |
|---|---|
| Onion root fly | White maggots in the roots or bulb, plant pulls up easily |
| White rot | Fluffy white mould and tiny black dots at the base, no maggots |
| Allium leaf miner | Rows of tiny dots on leaves, brown pupae in the leaves or bulb |
| Downy mildew | Pale patches and grey-purple fuzz on the leaves, bulb firm |
If you find fluffy white mould, read the allium white rot guide. If the leaves show rows of tiny white dots, it’s allium leaf miner, which needs different timing.

The adult onion fly looks a lot like a small housefly. It’s the maggots that do the damage.
When does onion root fly attack?
The first flies lay eggs in May, at the base of young plants. The maggots hatch within days and feed for a few weeks. This first wave does the most harm, because the plants are small.
There can be two or three generations a year. Later maggots in summer tunnel into bigger bulbs, which then rot in the ground or in store. The young maggots of the last generation turn into pupae in the soil and wait there until spring.
| Month | What to do |
|---|---|
| March to April | Plant sets in a new bed. Cover with fine mesh straight away |
| May to June | Peak risk. Check under the mesh weekly and lift any wilting plants |
| July to August | Keep the mesh on. Later generations attack bigger bulbs |
| August to September | Lift and dry the crop. Bin any soft or tunnelled bulbs |
| October to February | Dig or fork over last year’s onion bed so birds can find pupae |
Defence 1: Cover with fine insect mesh
Fine insect mesh is the most reliable defence. It stops the flies laying eggs at the base of the plants. Fleece works too, though it gets warm in summer and weeds grow fast underneath.
- Put it on at sowing or planting, before the flies arrive in May.
- Use proper insect-proof mesh, the kind sold for carrot fly. Bird or butterfly netting has holes far too big.
- Support it on hoops so the mesh doesn’t rest on the leaves.
- Bury or weigh down every edge. Flies walk in under any gap.
- Check for tears every week or two and patch them.
- Open it briefly for weeding, then close it again.
Mesh only works if the flies are kept out from the start. Covering plants after eggs are laid traps the maggots in with your onions. And don’t put mesh over last year’s onion bed, as flies hatching from the soil end up trapped inside.

Mesh on hoops with every edge weighed down. Flies can’t lay eggs on what they can’t reach.
Defence 2: Grow from sets, not seed
Onion sets usually suffer less than seed-sown onions. Seedlings need thinning, and the bruised leaves give off an oniony smell that draws egg-laying flies in. Sets need no thinning and grow away faster.
If you do grow from seed, thin on a still evening, firm the soil back round the remaining plants and water them. Clear away the thinnings rather than leaving them on the bed. For tips on choosing and planting sets, see the guide to growing onions.
Defence 3: Move onions to a new bed each year
Onion fly pupae spend winter in the soil where last year’s onions grew. Move onions, shallots, leeks and garlic to a different bed each year so the new crop isn’t sitting on top of them. The crop rotation planner shows how to fit this into a plot.
Rotation won’t keep out flies flying in from nearby, so pair it with mesh.
Defence 4: Lift and bin affected plants
Pull out wilting plants as soon as you see them, with the soil round the roots. Bag them and put them in the general waste bin, not the compost heap. This takes the maggots out before they turn into the next wave of flies.

Lift wilting plants with their soil and bin them, so the maggots never become next year’s flies.
At harvest, bin any soft or tunnelled bulbs too. Don’t store them with sound ones.
Defence 5: Fork over the old bed in winter
After harvest, fork or dig over last year’s onion bed in autumn or winter. It brings some of the pupae to the surface, where robins, blackbirds and other birds can find them. It won’t clear them all, but it helps alongside rotation.
There is no insecticide for home gardeners to use against onion fly, so these physical and cultural steps are the way to control it.

Kept under mesh until harvest, onions can swell without a single maggot getting in.
Common mistakes with onion root fly
Netting too late. Once eggs are laid, mesh traps the maggots in. Cover at planting.
Using bird netting. The holes are far too big. Only fine insect mesh or fleece keeps the flies out.
Leaving gaps at the edges. Flies walk underneath. Bury or weigh down every edge.
Thinning seedlings and leaving the bits. The smell draws flies straight to the row. Clear up and water afterwards.
Composting infested plants. The maggots carry on and become next year’s flies. Bin them instead.
Frequently asked questions
How do I prevent onion root fly in the UK?
Cover onions with fine insect mesh or fleece from planting. Seal the edges so flies can’t crawl under. Grow from sets rather than seed, rotate beds each year, and lift and bin any affected plants promptly.
What does onion root fly damage look like?
Leaves turn yellow, then the plant wilts and flops. Lift it and you’ll find small white maggots in a soft, tunnelled bulb or root plate. Badly hit plants pull up with almost no roots.
When does onion root fly attack UK onions?
Mostly from May to June, when the first maggots hit young plants. Later generations can attack again through summer, tunnelling into bigger bulbs. Keep crops covered until you lift them.
Will mesh netting really stop onion root fly?
Yes, if it goes on before the flies lay eggs. Use fine insect-proof mesh, not bird netting. Bury or weigh down every edge and check for tears often.
Are onion sets less likely to get onion fly than seed?
Yes, sets usually suffer less than seed-sown onions. Seedlings need thinning, and the bruised leaves give off a smell that draws the flies in. Sets need no thinning, and they’re also bigger and tougher.
Can I spray for onion root fly?
No, there is no insecticide for home gardeners to use on it. Mesh, sets, rotation and removing affected plants are the ways to control it.
Find more crop pests in the problems hub. The same mesh keeps out a close cousin, so read the guide to carrot root fly next.
Our team produces practical UK gardening guidance from source research, contributor records and established horticultural practice. Editorial standards are overseen by Matt W.