The effective management of shared pathogens between wild ungulates and livestock requires the understanding of the processes of interaction between them. In this work, we studied the interspecific frequency of interaction (ifreq) and its spatiotemporal pattern between wild and domestic ungulates that coexist in free‐ranging farms. For this purpose, 6 red deer, 6 wild boar, 8 Iberian pigs and 3 cattle were monitored using GPS devices during the “montanera” period (the period in which Iberian pigs are maintained in extensive conditions to feed on acorn). The ifreq was quantified for two spatiotemporal windows: 30 m – 10 min, for inferring potential direct interactions (short window), and 30 m – 12 days for indirect interactions (large window). Secondly, the variation in the ifreq was modelled with regard to 2 temporal (time of the day and week of the year) and 4 environmental factors (distance to water, distance to vegetation cover, Quercus density and distance to feeding points). The interactions at the short window were scarce (N = 13); however, they were very frequent at the large one (N = 37,429), with the red deer as the species with the greatest involvement in the interactions. Models showed that the time of the day and distance to water were the variables that best predicted the ifreq and they were conditioned by differences in the activity pattern of the targeted species. Food resource availability also predicted the ifreq, especially at the short window and between wild species. The results presented here highlight the role that wild ungulates may play in the transmission of pathogens to extensive livestock in general and pigs in particular and show the epidemiological risk of certain areas, periods of time and management practices (for wildlife and livestock) as well as providing useful information in the prevention of the transmission of shared pathogens.