Abiotic and biotic properties of soil can influence growth and chemical composition of plants. Although it is well-known that soil microbial composition can vary greatly spatially, how this variation affects plant chemical composition is poorly understood. We grew genetically identical Jacobaea vulgaris in sterilized soil inoculated with live soil collected from four natural grasslands and in 100% sterilized soil. Within each grassland we sampled eight plots, totalling 32 different inocula. Two samples per plot were collected, leading to three levels of spatial variation: within plot, between and within grasslands. The leaf metabolome was analysed with 1H Nuclear magnetic resonance spectroscopy (NMR) to investigate if inoculation altered the metabolome of plants and how this varied between and within grasslands. Inoculation led to changes in metabolomics profiles of J. vulgaris in two out of four sites. Plants grown in sterilized and inoculated soils differed in concentrations of malic acid, tyrosine, trehalose and two pyrrolizidine alkaloids (PA). Metabolomes of plants grown in inoculated soils from different sites varied in glucose, malic acid, trehalose, tyrosine and in one PA. The metabolome of plants grown in soils with inocula from the same site was more similar than with inocula from distant sites. We show that soil influences leaf metabolomes. Performance of aboveground insects often depends on chemical composition of plants. Hence our results imply that soil microbial communities, via affecting aboveground plant metabolomes, can impact aboveground plant-insect food chains but that it is difficult to make general predictions due to spatial variation in soil microbiomes.