Sulfonylurea (SU) herbicides are widely used and often detected in environmental matrices and have toxic effects on ecosystems and plant development. However, the interaction between SU and soil-plant metabolism during the whole wheat growth cycle remains poorly investigated. Field trials demonstrated that bensulfuron methyl exposure reduced wheat height and a thousand grains' weight, disrupting the critical metabolic pathways, including linoleic acid and amino acid metabolism in the maturity stage. During different growth processes, bensulfuron methyl exposure decreases wheat soil and plants' defense-related indole alkaloid compounds, such as benzoxazinoids and melatonin. Microbial sequencing results showed that bensulfuron methyl treated decreased the abundance of beneficial microorganisms (Gammaproteobacteria, Bacteroidia, and Blastocatella) in the rhizosphere soil, which positively correlated with the inhibition of soil enzyme activity and the secretion of allelopathic substances (benzoxazinoids and melatonin). Molecular docking further confirmed that bensulfuron methyl affects protein molecular structure by establishing hydrogen bonds, which disequilibrate wheat benzoxazinoids and melatonin metabolism. Therefore, bensulfuron methyl exposure disrupted the interaction between soil microorganisms and indole alkaloid metabolism, hindering plant development. This study provides constructive insights into the environmental risks of herbicides and agricultural product safety throughout wheat development.