Deleterious effects of habitat loss and fragmentation on biodiversity have been demonstrated in numerous taxa. Although parasites represent a large part of worldwide biodiversity, they are mostly neglected in this context. We investigated the effects of various anthropogenic environmental changes on gastrointestinal parasite infections in four small mammal hosts inhabiting two landscapes of fragmented dry forest in northwestern Madagascar. Coproscopical examinations were performed on 1,418 fecal samples from 903 individuals of two mouse lemur species,
Microcebus murinus
(
n
= 199) and
M. ravelobensis
(
n
= 421), and two rodent species, the native
Eliurus myoxinus
(
n
= 102) and the invasive
Rattus rattus
(
n
= 181). Overall, sixteen parasite morphotypes were detected and significant prevalence differences between host species regarding the most common five parasites may be explained by parasite–host specificity or host behavior, diet, and socioecology. Ten host‐ and habitat‐related ecological variables were evaluated by generalized linear mixed modeling for significant impacts on the prevalence of the most abundant gastrointestinal parasites and on gastrointestinal parasite species richness (GPSR). Forest maturation affected homoxenous parasites (direct life cycle) by increasing
Lemuricola
, but decreasing Enterobiinae gen. sp. prevalence, while habitat fragmentation and vegetation clearance negatively affected the prevalence of parasites with heterogenic environment (i.e.,
Strongyloides
spp.) or heteroxenous (indirect cycle with intermediate host) cycles, and consequently reduced GPSR. Forest edges and forest degradation likely change abiotic conditions which may reduce habitat suitability for soil‐transmitted helminths or required intermediate hosts. The fragility of complex parasite life cycles suggests understudied and potentially severe effects of decreasing habitat quality by fragmentation and degradation on hidden ecological networks that involve parasites. Since parasites can provide indispensable ecological services and ensure stability of ecosystems by modulating animal population dynamics and nutrient pathways, our study underlines the importance of habitat quality and integrity as key aspects of conservation.