Odorous contamination would occur in the polluted soils' remediation of the abandoned industry factory. To suppress odorous substances’ emissions, a novel foam was prepared with plant protein, xanthan gum, and alkyl glycosides. Since xanthan gum and alkyl glycosides have the characteristics of prolonged foam half-life and enhanced foaming ability, the optimal ratio of xanthan gum to alkyl glycosides is crucial during foam formulation determination. When xanthan gum concentration increased from 0.00% to 0.30%, the viscosity of the foaming solution increased from 12 to 223 mPa∙s, while the surface tension declined by 12.3%. As a result, the foam half-life increased from 0.3 to 56 h, and the foaming volume decreased by 25.5%. On contrary, with the addition of alkyl glycosides, the surface tension decreased significantly, and the foaming volume increased by 36.5% under the xanthan gum concentration of 0.30%. Therefore, the optimal content of xanthan was 0.30% in the presence of 100 mM alkyl glycoside. Then, this novel foam could prevent 67% of p-xylene from escaping within 24 h. In actual sites, novel foams showed a barrier rate of over 75% on different odorous substances most of the time.