Irinotecan inhibits cell proliferation and thus is used for the primary treatment of colorectal cancer. Metabolism of irinotecan involves incorporation of β-glucuronic acid to facilitate excretion. During transit of the glucuronidated product through the gastrointestinal tract, an induced upregulation of gut microbial β-glucuronidase (GUS) activity may cause severe diarrhea and thus force many patients to stop treatment. We herein report the development of uronic isofagomine (UIFG) derivatives that act as general, potent inhibitors of bacterial GUSs, especially those of Escherichia coli and Clostridium perfringens. The best inhibitor, C6-nonyl UIFG, is 23,300-fold more selective for E. coli GUS than for human GUS (Ki = 0.0045 and 105 μM, respectively). Structural evidence indicated that the loss of coordinated water molecules, with the consequent increase in entropy, contributes to the high affinity and selectivity for bacterial GUSs. The inhibitors also effectively reduced irinotecan-induced diarrhea in mice without damaging intestinal epithelial cells.