There seem to be no resistant varieties at this time except for a Japanese bunching onion that at times shows resistance, or at least tolerance. Rotation as a method of maggot control is not practical for the home gardener, but controlling wild onions should help. Volunteer onions and chives may be a source of infestations. The onions should be removed and the wastes burned and not plowed into the soil. Highly organic soil may be more attractive to the flies.
Authorities differ as to whether fall plowing is advisable.
Controlling the spring infestation is most important because small or new plants are most easily damaged. Killing flies or maggots in the spring helps lower populations in the fall. Diazinon is an insecticide available to home gardeners. Do not use diazinon on onions within 10 days of harvest or use. Do not use diazinon on bunch onions.