Diets high in cholesterol alter intestinal immunity. Here, we examined how the cholesterol metabolite 25-hydroxycholesterol (25-HC) impacts the intestinal B cell response. Mice lacking cholesterol 25-hydroxylase (CH25H), the enzyme generating 25-HC, had higher frequencies of immunoglobulin A (IgA)-secreting antigen-specific B cells upon immunization or infection. 25-HC did not affect class-switch recombination but rather restrained plasma cell (PC) differentiation. 25-HC was produced by follicular dendritic cells and increased in response to dietary cholesterol. Mechanistically, 25-HC restricted activation of the sterol-sensing transcription factor SREBP2, thereby regulating B cell cholesterol biosynthesis. Ectopic expression of SREBP2 in germinal center B cells induced rapid PC differentiation, whereas SREBP2 deficiency reduced PC output in vitro and in vivo. High-cholesterol diet impaired, whereas Ch25h deficiency enhanced, the IgA response against Salmonella and the resulting protection from systemic bacterial dissemination. Thus, a 25-HC-SREBP2 axis shapes the humoral response at the intestinal barrier, providing insight into the effect of high dietary cholesterol in intestinal immunity.