Human-induced habitat alterations globally threaten animal populations, often evoking complex behavioural responses in wildlife. This may be particularly dramatic when negatively affecting social behaviour, which fundamentally determines individual fitness and offspring survival in group-living animals. Here, we provide first evidence for significant behavioural modifications in sociality of southern pig-tailed macaques visiting Malaysian oil palm plantations in search of food despite elevated predation risk. Specifically, we found critical reductions of key positive social interactions but higher rates of aggression in the plantation interior compared to the plantation edge (i.e. plantation areas bordering the forest) and the forest. At the plantation edge, affiliation even increased compared to the forest, while central positions in the macaques' social network structure shifted from high-ranking adult females and immatures to low-ranking individuals. Further, plantations also affected mother-infant relationships, with macaque mothers being more protective in the open plantation environment. We suggest that although primates can temporarily persist in human-altered habitats, their ability to permanently adapt requires the presence of close-by forest and comes with a trade-off in sociality, potentially hampering individual fitness and infant survival. Studies like ours remain critical for understanding species' adaptability to anthropogenic landscapes, which may ultimately contribute to facilitating their coexistence with humans and preserving biodiversity.