It’s common for your immune system to weaken during pregnancy, making you more susceptible to catching an illness. On top of it, you’re more at risk for a urinary tract infection (UTI) between six and 24 weeks as the uterus grows and puts more pressure on your bladder, blocking the drainage of urine. “It’s a good idea to start taking a probiotic [after finding out you are pregnant], which will help maintain the good bacteria in your gut and vagina,” explains Andrea Chisholm, MD, a board-certified OBGYN and member of the Verywell Family review board. Whether you’re stuck with an upper-respiratory infection or UTI, there’s one main treatment they have in common—antibiotics. The good news is that antibiotics are generally considered safe for you and your baby during pregnancy. Here, we’ll take a closer look at why antibiotics are used during pregnancy, their benefits, and any safety precautions you should take.

What Are Antibiotics?

Antibiotics are medicines that fight infections caused by bacteria, which are germs that live in the environment as well as inside and outside our bodies. Most bacteria are harmless (or even helpful), but in some cases, they can cause infections. Darren Salinger, MD, OBGYN from KIDZ Medical Services in Florida, explains that the most common reasons antibiotics may be needed during pregnancy include:

Acne treatment Skin infections Pneumonia Sinus infections Upper respiratory tract infections Urinary tract infections (UTIs) Kidney infections Group B Strep colonization during labor Preterm labor Appendicitis Gallbladder disease (cholecystitis) Sexually transmitted diseases (STDs)

Antibiotics are not used to treat viral infections, such as the flu or the common cold. The most common side effects of antibiotics include rash, nausea, diarrhea, and yeast infections.

Is It Safe to Take Antibiotics During Pregnancy?

Generally speaking, antibiotics are considered safe. “Antibiotics are effective for many common infections and can be used during pregnancy,” confirms Dr. Salinger. Moreover, research suggests that around one in four pregnant women will be prescribed an antibiotic during pregnancy, which accounts for nearly 80 percent of prescription medications for pregnant women. Dr. Salinger explains that medications, including antibiotics, are grouped into risk categories to help determine whether they are safe to take during pregnancy. They are grouped into the following categories:

Category A and B: Medications considered safe for pregnant peopleCategory C: Medications considered generally safe but should only be used if necessary, as there are risksCategory D: Medications known to cause potential harm, but may be taken if the benefit is greater than the risk of harmCategory X: Medications that should not be used during pregnancy

“There are a [couple of] antibiotics to avoid,” explains Dr. Salinger. “Tetracycline, which can cause fetal teeth to turn yellow, and streptomycin, which may cause fetal hearing loss.”

Penicillins, including amoxicillin and Augmentin, used for bacterial infections Ampicillin, used during labor in people with group beta streptococcus colonization Vancomycin, used in labor for group beta streptococcus infection with a penicillin allergy Cephalosporins, including Kelex, used for bacterial infections Clindamycin, used for bacterial infections Macrobid (Nitrofuratoin), used for UTIs Clindamycin cream, Metronidazole and Metrogel, used for bacterial vaginosis Rocephin (Ceftriaxone), used for gonorrhea

Both are typically used to treat bacterial infections. “Historically the group of antibiotics called fluoroquinolones, like ciprofloxacin or levofloxacin, were considered unsafe in pregnancy,” adds Dr. Chisholm. “Recent evidence suggests [they are] unlikely to be harmful, but should be avoided in the first trimester.”

What If I Take Antibiotics Before Realizing I’m Pregnant?

While many antibiotics are considered safe during pregnancy, Dr. Salinger cautions that a few, in particular, are associated with an increased miscarriage if taken before 20 weeks. A 2017 study found that azithromycin (Z pack), Cipro, and Bactrim (commonly used for respiratory illnesses and UTIs) increased the risk of miscarriage during the first trimester. That said, the risk is said to be very low. If you took one of these antibiotics before realizing you were pregnant, try not to panic—after all, you didn’t know! The best thing you can do is make an appointment with your healthcare provider to discuss the next steps and ensure all is well with baby.

Safety Precautions

In a 2020 study published in The BMJ, researchers took a closer look at macrolide (a specific class of antibiotics during pregnancy. They found that the risk of any birth defect, specifically heart defects, was higher if macrolides were used instead of penicillin during the first trimester. Fortunately, it was determined that the risk is still quite low. Ultimately, any risk should be balanced against the more serious problems that can arise for babies whose parents are not treated for bacterial infections during pregnancy. “If the benefits outweigh the risks, then you are OK taking [that] medication during pregnancy,” says Dr. Salinger. As a precaution, pregnant individuals should avoid taking macrolide antibiotics, including clarithromycin and azithromycin. While the risks may not be high, it’s always best to choose a safer antibiotic, and your healthcare provider can offer advice if and when antibiotics are needed during your pregnancy. “[A] general rule when it comes to antibiotics in pregnancy—make sure that an actual infection needing antibiotic treatment is diagnosed,” adds Dr. Chisholm.

When Can I Resume Taking Antibiotics?

It is safe to resume taking most all antibiotics after delivery, but there are certain precautions to take if you are breastfeeding. It’s important to ensure the medicine you’re taking is safe for your child since it can pass through breastmilk during feeding. That said, the CDC concluded that most prescription medications are safe to take while breastfeeding. When it comes to antibiotics, however, there are certain types that should be avoided, according to Dr. Chisoholm. “[It is] typically recommended to avoid metronidazole and tetracycline while breastfeeding,” she says. Metronidazole is commonly used for bacterial infections of the vagina, and tetracycline is often used to combat bacterial infections such as gastritis, pneumonia, and chlamydia. Of course, it’s always important to speak with your healthcare provider about any antibiotics you plan on taking while breastfeeding.

A Word From Verywell

While UTIs and respiratory illnesses during pregnancy are tough, the silver lining is that treating them with antibiotics is considered safe for you and your unborn baby. It’s important to remember that if the risk to your baby is greater from leaving a bacterial infection untreated, an antibiotic is likely the best option. A healthcare provider or OBGYN is the best resource when it comes to medication use during pregnancy, so above all else, consult them first to ensure you receive the safest treatment for you and your baby.