If you drink coffee with a UTI, the caffeine will irritate your already inflamed urinary tract and make your symptoms worse. You might feel the urge to urinate more often, and you may experience burning when you do. You may also have trouble sleeping due to increased urgency and pain. If you're experiencing these symptoms, it's best to avoid caffeine until your infection has cleared.