Skip to main content
Diet and Nutrition

4 Food and Drinks to Avoid While Taking Sulfamethoxazole / Trimethoprim (Bactrim)

Brian Clista, MDChristine Giordano, MD
Written by Brian Clista, MD | Reviewed by Christine Giordano, MD
Updated on July 11, 2025

Key takeaways:

  • Sulfamethoxazole / trimethoprim (Bactrim) is an antibiotic that can be used to treat infections of the urinary tract, skin, lung, and gut. 

  • Bactrim can cause side effects like upset stomach and diarrhea. Avoid spicy, acidic, and greasy foods while taking Bactrim as they may increase your risk of these side effects. 

  • Bactrim can interact with alcohol. It’s best to avoid drinking alcohol while taking Bactrim. 

Save on related medications

Bactrim is an antibiotic often used to treat urinary tract infections (UTIs). It’s also used to treat infections of the skin, lung, and gut. Bactrim is actually a combination of two medications:  sulfamethoxazole and trimethoprim. It works by interfering with the DNA and protein production that bacteria use to grow. 

Bactrim can cause an upset stomach, so limiting foods that can irritate the stomach may make taking this antibiotic easier. That said, there aren’t many foods you need to avoid when taking Bactrim. Let’s look at some of the foods to avoid or limit while on Bactrim. 

1. Acidic foods

Bactrim is absorbed rapidly in the gut. This means that unlike some other antibiotics, Bactrim is easily digested regardless of what you drink or eat with it. So there aren’t any foods to avoid while taking Bactrim to make sure the medication works properly. 

But you may want to limit certain foods to reduce the risk of side effects. Bactrim can cause nausea or vomiting. If eating acidic foods bothers your stomach, avoid them while taking Bactrim.    

2. Alcohol

It’s never a great idea to drink alcohol when you’re taking antibiotics. Most antibiotics, including Bactrim, can cause nausea or diarrhea. Adding alcohol to the mix can worsen that side effect.  

In addition, Bactrim may interfere with how the body processes alcohol, leading to high levels of acetaldehyde in the blood. This can lead to a serious condition called a disulfiram-like reaction

Signs of a disulfiram-like reaction include:

  • Sweating

  • Flushing

  • Fast heart rate

  • Nausea and vomiting

Fortunately, the risk of this reaction may be lower than once thought. A recent review found only weak evidence to support the link between Bactrim, alcohol, and the disulfiram-like reaction. But most healthcare professionals still advise people to avoid alcohol while taking Bactrim.     

GoodRx icon
  • Dos and don’t of antibiotics: Hear from physicians about when you should and shouldn’t take an antibiotic

  • How does it feel to take Bactrim? People share their thoughts about taking the antibiotic Bactrim (sulfamethoxazole / trimethoprim).

  • What’s the best antibiotic treatment for UTI? This is how Bactrim and Macrobid compare for treating urinary tract infections (UTIs).

3. Bananas and other potassium-rich foods

Potassium is an important electrolyte. The trimethoprim component of Bactrim interferes with how the kidney eliminates potassium. That can raise potassium levels in the blood. 

For most people taking Bactrim, this won’t cause any problems. But if you have kidney disease or take other medicines that also raise potassium levels, you may be at risk for developing high potassium levels (hyperkalemia). Hyperkalemia can be dangerous.

Avoid taking in extra potassium by limiting high-potassium foods, such as:

  • Apricots

  • Avocados

  • Bananas

  • Beans

  • Beets

  • Leafy greens like spinach and kale

  • Sweet potatoes

Talk with your healthcare team if you have kidney problems or take medications that increase your potassium before starting Bactrim.

4. Caffeine

Food and drinks with caffeine don’t interact strongly with Bactrim. But that doesn’t necessarily mean that you should drink a lot of caffeine when you’re taking Bactrim. 

Caffeine has a diuretic effect, which means it can make you pee more often. Normally, caffeine doesn’t cause dehydration. So most people can still enjoy their usual tea or coffee drinks while taking Bactrim. But if you’re dehydrated because you have a fever and you aren’t eating much, then you should focus on noncaffeinated drinks to help you stay hydrated instead. 

What else can you do to make it easier to take sulfamethoxazole / trimethoprim (Bactrim)?

Apart from avoiding or limiting certain foods and drinks, there are other things you can do to make it easier to take Bactrim and reduce the risk of side effects.

Take Bactrim with food 

Taking Bactrim with a meal or snack may reduce your risk of an upset stomach. If you do feel nauseated, try eating small, frequent meals. Pick bland, starchy foods like toast, crackers, and applesauce. 

Stay hydrated 

Take Bactrim with a full glass of water. Bactrim can cause development of crystals in the urine. These crystals can lead to kidney injury. Staying hydrated reduces the risk of crystal formation.

Eat foods to support a healthy gut 

Any antibiotic, including Bactrim, can kill off good gut bacteria. Eating probiotic foods like yogurt and pickled vegetables can help restore healthy bacteria in the gut. Whole grains, fruits, and legumes are a good source of prebiotics. Prebiotics can also help keep your gut microbiome healthy. 

Avoid foods that upset your stomach 

If Bactrim upsets your stomach, it’s best to stay away from foods that can worsen that side effect. For many people, that means limiting spicy or greasy foods.

Frequently asked questions

Yes, you can eat chocolate while taking Bactrim. Chocolate isn’t a food you need to avoid when taking antibiotics. 

Yes, you can eat dairy while taking Bactrim. Opt for dairy products that contain probiotics, like yogurt or kefir. Probiotics can help keep your gut microbiome healthy while you’re taking antibiotics.

Yes, you can eat eggs while taking Bactrim. Eggs are nutrient dense, which makes them a great choice when you are sick and don’t feel like eating much. 

The bottom line

Bactrim is absorbed very quickly, so you don’t have to worry about foods and drinks making Bactrim less effective. However, like many antibiotics, Bactrim can cause nausea and vomiting. Reduce your chance of getting an upset stomach while taking Bactrim by avoiding acidic or spicy foods. Most healthcare professionals advise people to avoid alcohol while on Bactrim.  Drinking alcohol while taking Bactrim can increase the risk of serious side effects — but this is rare. 

why trust our exports reliability shield

Why trust our experts?

Brian Clista, MD
Written by:
Brian Clista, MD
Dr. Clista is a board-certified pediatrician who works in private practice in Pittsburgh, Pennsylvania. He previously served as a National Health Service Corporation Scholar in the inner city of Pittsburgh for 11 years.
Patricia Pinto-Garcia, MD, MPH, is a medical editor at GoodRx. She is a licensed, board-certified pediatrician with more than a decade of experience in academic medicine.
Christine Giordano, MD, is board-certified in general internal medicine. She received her medical degree from Rutgers New Jersey Medical School and completed residency at Thomas Jefferson University.

References

GoodRx Health has strict sourcing policies and relies on primary sources such as medical organizations, governmental agencies, academic institutions, and peer-reviewed scientific journals. Learn more about how we ensure our content is accurate, thorough, and unbiased by reading our editorial guidelines.

Was this page helpful?

Latest articles