It is recommended to avoid bactrim for UTI in pregnancy, specifically in the first trimester, to avoid the possible side effects of neural tube in developing fetus. It's important to consult with your healthcare before taking any medication during pregnancy to avoid any possible side effects.