Cognitive impairment in the elderly is associated with alterations in bile acid (BA) metabolism. In this study, we observe elevated levels of serum conjugated primary bile acids (CPBAs) and ammonia in elderly individuals, mild cognitive impairment, Alzheimer's disease, and aging rodents, with a more pronounced change in females. These changes are correlated with increased expression of the ileal apical sodium-bile acid transporter (ASBT), hippocampal synapse loss, and elevated brain CPBA and ammonia levels in rodents. Invitro experiments confirm that a CPBA, taurocholic acid, and ammonia induced synaptic loss. Manipulating intestinal BA transport using ASBT activators or inhibitors demonstrates the impact on brain CPBA and ammonia levels as well as cognitive decline in rodents. Additionally, administration of an intestinal BA sequestrant, cholestyramine, alleviates cognitive impairment, normalizing CPBAs and ammonia in aging mice. These findings highlight the potential of targeting intestinal BA absorption as a therapeutic strategy for age-related cognitive impairment.