Urban environments may offer certain species diverse and abundant food resources of natural and anthropogenic origin. However, the local-scale configuration of habitats and urban infrastructure may influence foraging decisions regardless of the availability of food. In recent years, the expansion of wild boar Sus scrofa into areas significantly transformed by humans has been observed in many parts of its range. Grubbing (rooting) is a major foraging mode of the species, during which disturbance of the upper soil layers enables these animals to find and consume food items. However, the factors that determine the selection of grubbing sites in the urban landscape, where the balance between food availability and the avoidance of humans may influence foraging decisions, are not known. Our aim was to identify local-scale factors that influence grubbing site selection and the size of grubbed patches in an urban landscape. The characteristics of 108 wild boar grubbing sites in the city of Kraków (Poland) were compared to randomly selected control sites. The probable presence of a grubbing site was positively correlated with the proportion of meadows and fallow land in the vicinity and with increases in both canopy cover and distance to pavements. The size of a grubbed patch was positively correlated with the percentage of meadows in the vicinity, increasing distance to buildings and decreasing distance to pavements. We found a non-random pattern of grubbing sites in the urban landscape and indicated that the local-scale configuration of vegetation and urban infrastructure contribute to foraging site selection by wild boar. Our study highlights that the encroachment of wildlife into the urban landscape is a complex process, driven by both resource availability and the avoidance of human-related disturbances.