Microbiomes of soils and plants are linked, but how this affects microbiomes of aboveground herbivorous insects is unknown. We first generated plant-conditioned soils in field plots, then reared leaf-feeding caterpillars on dandelion grown in these soils, and then assessed whether the microbiomes of the caterpillars were attributed to the conditioned soil microbiomes or the dandelion microbiome. Microbiomes of caterpillars kept on intact plants differed from those of caterpillars fed detached leaves collected from plants growing in the same soil. Microbiomes of caterpillars reared on detached leaves were relatively simple and resembled leaf microbiomes, while those of caterpillars from intact plants were more diverse and resembled soil microbiomes. Plant-mediated changes in soil microbiomes were not reflected in the phytobiome but were detected in caterpillar microbiomes, however, only when kept on intact plants. Our results imply that insect microbiomes depend on soil microbiomes, and that effects of plants on soil microbiomes can be transmitted to aboveground insects feeding later on other plants.