Xu et al. reveal that co-infection of nematodes and pathogens is a global phenomenon. Root-knot nematodes reprogram rhizosphere metabolism, reducing defensive tomatidine while increasing sugars that reshape rhizosphere microbiome. These changes suppress antagonistic microbes and promote pathogen proliferation, which enhances nematode survival and gall formation, leading to complex co-infection dynamics.