Skip to content

Guides

Onion Fly

Pest

The onion fly is a small insect whose larvae, known as onion maggots, burrow into the base of allium crops. This feeding causes the plants to wilt and rot, which can lead to significant crop loss if left unmanaged.

Symptoms by part

Roots

Small, white, legless maggots tunnel into the bulb and root system, causing the tissue to turn soft and mushy.

Stems

The base of the stem becomes hollowed out or rotten, leading to yellowing, wilting, and eventual collapse of the foliage.

Causes

  • Presence of adult flies attracted to the scent of damaged or young allium plants.
  • Planting onions or leeks in the same soil year after year.
  • Leaving rotting plant debris in the soil after harvest.
  • Poor soil drainage that keeps the base of the plant consistently damp.

Could be confused with

  • Onion White Rot · White rot shows a fuzzy white fungal growth at the base of the bulb, whereas onion fly damage is characterized by the presence of maggots.
  • Leek Moth · Leek moth larvae create visible mines or tunnels in the leaves, while onion fly larvae focus their damage on the bulb and stem base.

Treatment

  1. Immediately pull up and destroy any plants showing signs of wilting or yellowing to stop the maggots from maturing.
  2. Remove all soil surrounding the base of the infested plant to ensure no larvae remain in the ground.
  3. Dispose of infested plant material in the trash rather than the compost pile to prevent the life cycle from continuing.

Without chemicals

  • Cover young seedlings with fine horticultural fleece or insect netting to prevent adult flies from laying eggs.
  • Practice strict crop rotation by moving allium crops to a different part of the garden each year.
  • Firm the soil around the base of the plants after planting to make it harder for flies to reach the roots.
  • Delay planting until later in the season to avoid the peak activity period of the first generation of flies.

Preventing it

  • Rotate your allium crops on a 3 to 4 year cycle.
  • Remove and destroy all crop residues immediately after harvest.
  • Use physical barriers like fine mesh netting from the moment of planting until the plants are well established.
  • Avoid thinning seedlings during the peak flight times of the adult flies, as the scent of damaged foliage attracts them.

Season

The warm growing season, particularly during spring and early summer when the flies are most active.

Spread risk

Moderate

Severity

High

When to act

Act as soon as you notice wilting or yellowing leaves on your onions or leeks. If the bulb is already soft and mushy, remove the plant entirely to protect the rest of your crop.

Think it's Onion Fly?

This guide covers the general picture. Pocket Botanist looks at your actual plant from a photo and tells you what's really going on, how serious it is, and what to try first. Identification and a health check are free.

Download on the App StoreGet it on Google Play

Get the app · Or check it from a photo now, free

Questions people ask

Can I eat an onion if it has been attacked by onion fly?
It is best to discard any bulb that shows signs of maggot damage or rot, as the tissue will be compromised and prone to secondary infections.
Do onion flies affect other vegetables in my garden?
No, onion flies are specific to the allium family, including onions, leeks, garlic, and shallots.
How do I know if the flies are in my garden?
Adult flies are small and grey, often seen hovering low over allium beds, but the most common sign is the sudden wilting of young plants.

Plants it affects

Back to all guides

This guide was generated with AI and is general information, not horticultural advice. Read about how we build these guides.