Urinary tract infections (UTIs) caused by uropathogenic Escherichia coli (UPEC) affect 150 million people annually. Despite effective antibiotic therapy, 30-50% of patients experience recurrent UTIs. In addition, the growing prevalence of UPEC that are resistant to last-line antibiotic treatments, and more recently to carbapenems and colistin, make UTI a prime example of the antibiotic-resistance crisis and emphasize the need for new approaches to treat and prevent bacterial infections. UPEC strains establish reservoirs in the gut from which they are shed in the faeces, and can colonize the periurethral area or vagina and subsequently ascend through the urethra to the urinary tract, where they cause UTIs. UPEC isolates encode up to 16 distinct chaperone-usher pathway pili, and each pilus type may enable colonization of a habitat in the host or environment. For example, the type 1 pilus adhesin FimH binds mannose on the bladder surface, and mediates colonization of the bladder. However, little is known about the mechanisms underlying UPEC persistence in the gut. Here, using a mouse model, we show that F17-like and type 1 pili promote intestinal colonization and show distinct binding to epithelial cells distributed along colonic crypts. Phylogenomic and structural analyses reveal that F17-like pili are closely related to pilus types carried by intestinal pathogens, but are restricted to extra-intestinal pathogenic E. coli. Moreover, we show that targeting FimH with M4284, a high-affinity inhibitory mannoside, reduces intestinal colonization of genetically diverse UPEC isolates, while simultaneously treating UTI, without notably disrupting the structural configuration of the gut microbiota. By selectively depleting intestinal UPEC reservoirs, mannosides could markedly reduce the rate of UTIs and recurrent UTIs.