Bacteria and other infection-causing microbes may enter the urinary tract when an infant has a dirty diaper or when babies are wiped from back to front. Good hydration enabling frequent urination and maintaining proper hygiene can help prevent UTIs.