Heavy metals can accumulate and migrate in soil environments and can negatively affect crops and consumers. Because an increased incidence of chronic diseases can be observed, food security has become a high-priority concern. In the present work, we evaluate the impact of heavy metals on bioactive compounds and elemental content from onions. Plants were grown in the absence and presence of various concentrations of heavy metal salts (Pb, Mn, Cu, Zn, Ni and Cd). The influence of heavy metal salts on onions was evaluated by analyzing the content of bioactive compounds, antioxidant capacity, and elemental content. The variation of assimilatory pigments, total polyphenols content, and antioxidant capacity increased or decreased depending on the heavy metal added to the soil as well as on the amount added. Regarding the amount of bioactive compounds, it increased between 6.79 and 34.39% or decreased between 4.68 and 62.42%. The content of ten elements in plants was reported, as well as elemental mutual correlation and correlation of element content with biologically active compounds and antioxidant capacity.