How to Control Onion Maggots in the Soil
How to Control Onion Maggots in the Soil: What 30 Years of Losing and Saving Onions Taught Me
The first time I lost a whole bed of onions to maggots, I blamed the weather. It was a cool, wet spring, the seedlings were up and looking strong, and then one morning a row looked like someone had gone down it with a lawn mower. I pulled one wilted plant and it came out of the ground with no resistance at all. The roots were gone, the base was mush, and four or five small white maggots were wriggling in the wreckage. I had planted nearly an acre that year. I replanted twice and still lost about a third of the crop.
That was my tuition. Since then I have grown onions through dry years, flood years, and years when the maggots were so bad I considered switching to beans. Here is the short answer to your question, and then I will take you through the long one.
You do not control onion maggots in the soil with one trick. You control them by breaking their life cycle at three points: before they lay eggs, while the eggs and young maggots are in the ground, and after harvest when the pupae are hiding in your field waiting for next year. Rotate your onions away from any ground where alliums grew in the last three years. Cover young plants with fine insect netting from the day you plant until the egg-laying flies have passed. Clean up every cull, volunteer, and infested plant so nothing carries the problem forward. Add soil-level help such as beneficial nematodes or a labeled soil treatment if your pressure is high. If you do those four things in the right order, you will stop losing onions to this pest.
Know What You Are Fighting
Onion maggots are the larvae of a small grey fly, a little smaller than a housefly, with long legs and a habit of hovering low over the onion rows in spring. You will often see them in the cool morning hours, walking around the base of the plants. The flies themselves do not harm anything. The damage comes when they lay small white eggs in the soil right beside your onion stems, or sometimes on the plant base itself.
Those eggs hatch in a few days. The maggots, which are creamy white, legless, and about as long as a grain of rice when fully grown, crawl down into the soil and start feeding on the roots and the lower stem. In young seedlings they can kill a plant in a day or two. In bigger onions they bore into the bulb, and once they are inside, rot organisms follow them in and finish the job. When they are done feeding, they turn into brown pupae in the soil near the plant and wait. Depending on your climate, you may get two or three generations a season, and the last generation overwinters in the ground as pupae.
That last point is the one most farmers miss. The maggots you have this year are the children of the pupae you left in your soil last year.
What Most Farmers Get Wrong
After talking to a lot of growers over the years, I see the same mistakes again and again.
The first mistake is treating the symptom after it shows up. By the time you see wilting, yellowing, and flopping seedlings, the maggots have been feeding for days. Spraying the leaves at that stage does almost nothing, because the pest is below the soil line, not on the foliage. People spend money on foliar sprays and then wonder why nothing changed.
The second mistake is poor rotation. I have seen farmers plant onions, then shallots, then garlic, then onions again in the same field, thinking they were rotating because the crop name changed. All of those are alliums, and the maggots do not care what you call them. If you want to starve the pupae in your soil, the ground has to be free of any allium for at least three seasons, and four is better if you can manage it. Put brassicas, grains, or legumes in that spot instead.
The third mistake is leaving trash behind. A pile of cull onions at the edge of the field is a feeding station for the next generation. So are volunteer onions that sprout from missed bulbs, and so are infested plants you pulled and tossed aside instead of removing. I once found a heap of rotten onions behind my own shed, crawling with maggots, about forty feet from a bed I had just planted. I had created my own nursery for the pest.
The fourth mistake is applying fresh manure or heavy, undecomposed organic matter right before planting. The flies are strongly drawn to decaying plant material and fresh manure when they are choosing where to lay eggs. Well-rotted compost is fine. Fresh stuff is an invitation.
The fifth mistake is planting at the same time as everyone else and hoping for the best. Fly emergence follows soil temperature, and if you do not watch for it, you plant straight into the peak of egg laying.
The Step-by-Step Fix That Actually Works
Here is the sequence I follow now. I have it down to a routine, and I have not had a major maggot loss in many years.
Step one is to start with the field, not the plant. Before planting, I make sure the bed has had no alliums on it for at least three years. I keep a simple notebook with every field and what grew there each year. It sounds basic, but it is the most valuable thing I own for pest control. If a field does not qualify, I plant onions somewhere else.
Step two is to till or turn the soil well after harvest in the previous year, and again before planting. Pupae sitting near the surface are exposed to birds, cold, and drying when you turn the ground. I do a deep turn in late autumn after the last crop is out. Many pupae will not survive being exposed to a hard frost or sitting open on the surface. It does not wipe them out, but it cuts the numbers noticeably.
Step three is to remove everything that could host maggots. Before planting and again after harvest, I walk every row and the field edges. Every cull, every volunteer, every leftover bulb goes out of the field and either gets buried deep, composted in a hot pile, or burned. Infested plants during the season come out the same day, roots and soil around them included, and go in a sealed bag or a deep hole. Do not leave them on the ground, because the maggots will simply move to the next plant.
Step four is to cover the crop early. This is the single most effective thing I do. I lay lightweight insect netting, fine enough that the flies cannot get through, directly over the rows right after planting or transplanting, and I seal the edges with soil so nothing can sneak in from the sides. The flies cannot lay eggs on plants they cannot reach. I leave the cover on through the main egg-laying period, which usually runs for several weeks in spring. The one catch is that you must not cover a field where the pupae are already in the soil, because the flies will emerge right under your net and have the whole bed to themselves. That is why step one matters so much. Netting only works on clean ground.
Step five is to time your planting. I watch the flies. Yellow sticky cards set on stakes at the height of the plants will catch adults and tell you when they have arrived. When I see the first flies, I know egg laying is close. In cold springs I sometimes delay planting a week or two to let the first big wave pass, or I plant very early so the onions are large and tough before the flies arrive. Larger plants survive attack far better than tiny seedlings.
Step six is to use soil-level help when the pressure is high. If you have had heavy losses before, beneficial nematodes watered into the soil can reduce larvae. They work best when the soil is moist and warm enough for them to move, and they must be applied according to the product directions. Some growers also use a seed treatment or a soil drench containing spinosad or similar products approved in their area. I will not give you a dose here, because registered products, rates, and rules change by country and even by region. Read the label, follow it exactly, and ask your local extension office or agro-dealer what is approved for onions where you farm. Never copy a rate from a stranger’s article, including mine.
Step seven is to keep the soil and plants healthy. Water evenly. Stressed, weak plants take damage faster and recover slower. Avoid leaving wounded plants after thinning or weeding, because the cut tissue releases smells that attract egg-laying flies. When I thin, I remove the thinnings from the field immediately.
Warning Signs to Watch For
Learn to read the field early, because early detection saves entire beds.
Seedlings that wilt on a cool day when there is plenty of moisture are a red flag. If the plant pulls out with almost no resistance, the roots have been eaten. Look at the base for small white maggots, and check the soil within an inch or two of the stem.
Yellowing leaf tips that start at the outer leaves and spread inward can signal feeding damage underneath. In older onions, soft spots on the bulb, a sour smell, and plants that lean or flop over suggest the maggots are inside.
Tiny grey flies walking around the base of your plants in the morning, and sometimes small white eggs clustered in the soil crevices near the stem, tell you that egg laying has begun and you are about to have a problem.
A patchy stand, with gaps in the row where plants have simply vanished, often means maggots have worked through in a line. They tend to move from plant to plant along the row.
Walk your rows every few days in spring, and get down on your knees at least once a week to look closely. Ten minutes of looking saves weeks of regret.
What I Would Do Differently If I Were Starting Today
If I could go back to my first bad year, I would do five things from day one.
I would keep records from the very first season, noting where onions grew each year, because I wasted two seasons planting into infested ground simply because I forgot. I would buy insect netting before I bought anything else, because it has paid for itself many times over. I would clean up the field more aggressively, with no cull piles anywhere near my beds. I would start small, with one well-protected bed, and expand only after I knew my soil was clean. And I would talk to my neighbours, because maggots do not respect fence lines. When the farmers around me clean up their fields, my problem shrinks too.
I would also stop chasing chemical fixes first. I wasted a lot of money early on spraying at the wrong stage with the wrong product. Prevention costs less and works better.
Frequently Asked Questions
Can I save onions once the maggots are already inside the bulb?
Not really. Once the larvae are inside and rot has started, the bulb is lost. What you can do is remove the damaged plant, take the soil around it with it, and protect the plants beside it. Check the neighbours for early signs before the maggots spread along the row.
Do onion maggots live in the soil all year?
They spend the cold part of the year as pupae in the soil, and the flies emerge in spring once the ground warms. That is why rotation and cleanup matter so much, since the pest is waiting right where the last onion crop stood.
Will neem or wood ash get rid of onion maggots?
I have seen growers try both with mixed results. Neither replaces rotation, cleanup, and netting. Neem or ash may give some help as part of a bigger plan, but I would not rely on either as your only defence against a serious infestation.
Does crop rotation really make a difference?
Yes, and it is the foundation of everything else. Maggot flies are not strong travellers over long distances compared to how fast pupae can multiply in a field that keeps getting onions. Three or more years away from alliums starves out the local population dramatically.
Is it safe to replant right after losing seedlings to maggots?
Only after you remove the dead plants and soil around them and check for maggots. Replanting into the same soil with active larvae usually just feeds them a second meal. If the infestation is heavy, wait a couple of weeks, cover the new planting, or move to a clean field.
One Thing to Remember
Onion maggots are not defeated in the spray tank. They are defeated in your notebook, your net, and your cleanup, long before the first fly lands. Protect the ground, and the onions will take care of themselves.







