Applesauce (Best Option)
1/4 cup per 1/4 cup chopped onionApplesauce works well as a substitute because it contributes moisture and a subtle sweetness that complements the cupcake batter. The pectin and water content help maintain the desired crumb structure in the absence of onion's moisture.
When using applesauce, reduce other liquids slightly to avoid excess moisture. Monitor the batter consistency to ensure it is not too wet, which could affect rising.
Compared to onion, applesauce does not add any savory or pungent notes, resulting in a cupcake that is sweeter and more traditionally dessert-like, which is typically preferable.