Caenorhabditis elegans are soil-dwelling nematodes and models for understanding innate immunity and infection. Previously, we developed a novel fluorescent dye (KR35) that accumulates in the intestine of C. elegans and reports a dynamic wave in intestinal pH associated with the defecation motor program. Here, we use KR35 to show that mutations in the Ca2+-binding protein, PBO-1, abrogate the pH wave, causing the anterior intestine to be constantly acidic. Surprisingly, pbo-1 mutants were also more susceptible to infection by several bacterial pathogens. We could suppress pathogen susceptibility in pbo-1 mutants by treating the animals with pH-buffering bicarbonate, suggesting the pathogen susceptibility is a function of the acidity of the intestinal pH. Furthermore, we use KR35 to show that upon infection by pathogens, the intestinal pH becomes neutral in a wild type, but less so in pbo-1 mutants. C. elegans is known to increase production of reactive oxygen species (ROS), such as H2O2, in response to pathogens, which is an important component of pathogen defense. We show that pbo-1 mutants exhibited decreased H2O2 in response to pathogens, which could also be partially restored in pbo-1 animals treated with bicarbonate. Ultimately, our results support a model whereby PBO-1 functions during infection to facilitate pH changes in the intestine that are protective to the host.