Abstract Urban ecosystems can sustain populations of wild bees, partly because of their rich native and exotic floral resources. A better understanding of the urban bee diet, particularly at the larval stage, is necessary to understand biotic interactions and feeding behaviour in urban ecosystems, and to promote bees by improving the management of urban floral resources. We investigated the larval diet and distribution patterns of four solitary wild bee species with different diet specialization (i.e. Chelostoma florisomne, Osmia bicornis, Osmia cornuta and Hylaeus communis) along urban intensity gradients in five European cities (Antwerp, Paris, Poznan, Tartu and Zurich) using two complementary analyses. Specifically, using trap‐nests and pollen metabarcoding techniques, we characterized the species' larval diet, assessed diet consistency across cities and modelled the distribution of wild bees using species distribution models (SDMs). Our results demonstrate that urban wild bees display different successful strategies to exploit existing urban floral resources: not only broad generalism (i.e. H. communis) but also intermediate generalism, with some degree of diet conservatism at the plant family or genus level (i.e. O. cornuta and O. bicornis), or even strict specialization on widely available urban pollen hosts (i.e. C. florisomne). Furthermore, we detected important diet variation in H. communis, with a switch from an herbaceous pollen diet to a tree pollen diet with increasing urban intensity. Species distribution modelling indicated that wild bee distribution ranges inside urban ecosystems ultimately depend on their degree of specialization, and that broader diets result in less sensitivity to urban intensity. Policy implications. Satisfying larval dietary requirements is critical to preserving and enhancing wild bee distributions within urban gradients. For high to intermediate levels of feeding specialization, we found considerable consistency in the preferred plant families or genera across the studied cities, which could be generalized to other cities where these bees occur. Identifying larval floral preferences (e.g. using pollen metabarcoding) could be helpful for identifying key plant taxa and traits for bee survival and for improving strategies to develop bee‐friendly cities.