Onion Fly is a common pest that affects onions, shallots and leeks in Scotland. Here is what it looks like, how to spot the damage, and which controls have been tested.

What does it look like?
The adult is a 5-7mm grey fly, easily mistaken for a small house fly. The larva is what actually causes the damage: a white, legless, headless maggot that grows up to 10mm long as it feeds.
What causes it
Eggs are laid at the base of the leaves or in the soil right next to the plant, so simple proximity to an egg-laying female is what decides whether a plant gets targeted, rather than any weather condition. That sets it apart from several other soil-dwelling maggot pests on this site, where cold or wet soil is a real part of the story.
Is this pest active now?
Watch from May through the season, with damage peaking in June and July across up to three generations.
Symptoms
Seedlings can be killed outright. On mature plants, the outer leaves yellow and wilt as larvae feed on the roots and bulb below ground, and a badly affected bulb is destroyed and inedible by the time the damage is visible above ground.
Life cycle
Adults emerge from overwinteredKeeping a plant alive and intact through the cold months, whether left outdoors, moved under cover, or stored dormant. Full definition → pupae from May onwards, with up to three generations running through the year. A single female can lay over 200 eggs, which hatch within days; larvae then feed for around three weeks before pupating in the soil for two to three weeks.
Why this matters in Scotland
Central and eastern England is where this pest is most frequent, a genuine reason to expect lighter pressure in Scotland than the general UK picture, though not a reason to rule it out.
The May emergence date is a UK-generic figure. A Scottish spring that's slower to warm up pushes both the adult flies' first appearance and the vulnerable seedling stage later too, so the useful trigger for mesh or extra vigilance is what your own onion bed actually looks like that year, not the calendar date on its own.
Controls: what actually works
All the methods below are backed by real evidence, not just repeated folklore.
Grow from sets rather than seed
A set is already a small established bulb rather than a seed working through germinationA seed sprouting: breaking dormancy and putting out its first root and shoot, given the right warmth and moisture. Full definition →, which gives it a head start over the exact vulnerable early stage this pest targets.
Cover the crop with insect-proof mesh
A physical barrier over the row stops adult flies reaching the plants to lay eggs in the first place, useful for both seed-sown and set-grown crops.
Biological control: pathogenic nematodes watered into the soil
Sold as Fruit and Vegetable Protection, this drench targets the maggots directly in the soil, useful where mesh wasn't in place before egg-laying happened.
Remove and burn badly damaged late-season plants
A plant too far gone to save is still a source of larvae and pupae if left in the ground, so removing and burning it rather than composting it keeps that population from carrying over.
Encourage natural predators: birds, hedgehogs and ground beetles
All three are natural enemies that help keep populations down without any product or hand intervention needed.
Myths about onion fly
4 common claims about onion fly, checked: 3 busted1 disputed0 untested0 hold up
“Growing onions from sets instead of seed makes them immune to onion fly, so sets never need a mesh cover.”
Sets have a real advantage: they're already a small established bulb rather than a germinating seedling, so they get past the most vulnerable early stage faster. Growing guidance frames this as improved survival against the first generation of larvae, not as immunity, and it says nothing about later generations through the season. A set-grown onion can still be targeted by egg-laying females and still benefits from a physical barrier.
Our read The gap between 'improves survival' and 'immune' matters in practice: a gardener who skips mesh entirely because they used sets is relying on a head start, not a shield.
What to do: Use sets for the early-season advantage, but still cover the bed with fine insect mesh from planting through midsummer rather than treating sets as a substitute for the barrier.
1 source
- RHS, Onion flyGrowing onions and shallots from sets rather than seeds can help plants survive attacks by the first generation of larvae, alongside insect-proof mesh as a separate protective measure.
“Onion fly is the same insect as cabbage root fly, so the mesh timing and rotation advice for one applies directly to the other.”
Onion fly (Delia antiqua) and cabbage root fly (Delia radicum) are different species in the same genus, alongside a third relative, seed corn maggot (Delia platura), that attacks beans and sweetcorn. Purdue University's vegetable pest coverage describes the three as nearly identical to the naked eye as adults, which is likely where the confusion comes from, but each targets a different plant family: onion fly sticks to alliums, cabbage root fly to brassicasThe cabbage family: cabbage, kale, broccoli, cauliflower, Brussels sprouts, kohlrabi, swede, turnip and more, sharing the same pests, diseases and rotation rules. Full definition →, seed corn maggot to a much wider list of large-seeded vegetable crops.
Our read Family resemblance in the fly and the maggot is real and explains why they get lumped together in conversation, but host-plant targeting is specific enough that a brassica collar or a bean-bed precaution isn't doing anything for an onion bed.
What to do: Treat onion fly, cabbage root fly and seed corn maggot as separate pests needing their own barriers over their own crop: mesh or collars sized and timed to each bed rather than one blanket routine.
2 sources
- Purdue University Vegetable Crops Hotline, Seedling Damage by Maggot PestsOnion maggot (Delia antiqua), seed corn maggot (Delia platura) and cabbage root fly (Delia radicum) are distinct Delia species that look nearly identical as adults but target different host plants.
- RHS, Onion flyOnion fly is scoped to onions, shallots and leeks, with brassica and bean pests covered as separate entries rather than the same pest.
“Rotating your onion bed to a different spot in the garden each year is enough to stop onion fly building up.”
RotationMoving each crop family to different ground each year, on a multi-year cycle, so pests and diseases that build up in soil don't get a repeat host. Full definition → works against onion fly in principle, but only at a scale gardens don't have. The University of Maine's extension guidance states plainly that rotation as a method of maggot control isn't practical for the home gardener. Commercial guidance from the University of California backs up why: growers are told to keep new onion plantings at least three-quarters of a mile from the previous year's onion ground, because adult flies emerging from overwintered pupae can travel that kind of distance to find a new host bed. Moving a bed a few metres within the same plot doesn't approach that separation.
Our read This doesn't mean rotation is worthless, it means the plot-scale version gardeners actually practice isn't the mechanism doing the protecting; mesh and removing volunteer onions and chives are doing the real work at garden scale.
What to do: Keep rotating onions for soil health and disease reasons, but rely on insect mesh from planting onward, not bed position, as the actual defence against onion fly, and pull up any volunteer onions or chives nearby since they can harbour the pest between crops.
In Scotland: Most Scottish allotment plots and back gardens are far smaller than the separation distance that makes rotation effective against this pest, which is exactly why mesh matters more here than bed placement.
2 sources
- University of Maine Cooperative Extension, Onion MaggotRotation as a method of maggot control is not practical for the home gardener, though controlling wild onions and chives should help.
- University of California IPM Programme, Maggots (Onion and Garlic)New onion plantings should be kept at least three-quarters of a mile from fields planted to onion the previous year.
“Garlic gets hit by onion fly just as hard as onions, so it needs the same mesh protection.”
Garlic sits in an odd middle ground. Purdue's pest coverage lists garlic alongside onion and leek as a host that onion maggot has a strong preference for, and the fly can lay eggs on garlic. But the University of California's IPM programme, working from California field data, states maggots are serious pests of onion but do not generally cause economic damage to garlic. RHS's own onion fly page doesn't list garlic among the affected crops at all, scoping it to onions, shallots and leeks.
Our read The most likely explanation for the gap is that garlic can be attacked but tends to shrug off the damage better than a true onion bulb does, so 'host plant' and 'crop actually worth protecting' aren't the same question here.
What to do: Prioritise mesh on onions, shallots and leeks first; treat garlic as lower risk unless it's grown right alongside an infested onion bed, in which case covering it too costs little.
3 sources
- University of California IPM Programme, Maggots (Onion and Garlic)Maggots are serious pests of onions in California but do not generally cause economic damage to garlic.
- Purdue University Vegetable Crops Hotline, Seedling Damage by Maggot PestsOnion maggot has a strong preference for allium species including onion, garlic and leek.
- RHS, Onion flyOnion fly is scoped to onions, shallots and leeks; garlic isn't listed among the affected crops.
Frequently asked questions
What should I do first if I find onion fly in my garden?
Start with grow from sets rather than seed. After that, cover the crop with insect-proof mesh. Work through the rest in order of how well-evidenced they are if the first two aren’t enough on their own.
Will onion fly kill my plants?
Not usually outright, but it can genuinely cost you part of that year's harvest, not just something cosmetic a plant shrugs off. See the controls above for what actually reduces that risk.
When are onion fly most active in Scotland?
Check the seasonal activity section above. Scottish timings can run a few weeks behind the UK-generic figures.
Sources
4 sources, recorded with what each was used for
- RHS1: identification, symptoms, the proximity-based egg-laying trigger, life cycle and generations, growing from sets, insect-proof mesh, nematode drench, removing damaged plants, encouraging predators, England-frequency note, absence of a chemical control
- RHS1: confirming onion fly directly on onions' own growing page
- RHS1: confirming onion fly directly on shallots' own growing page
- RHS1: confirming onion fly directly on leeks' own growing page
