Skip to main content
Diet and Nutrition

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

Brian Clista, MDPatricia Pinto-Garcia, MD, MPH
Written by Brian Clista, MD | Reviewed by Patricia Pinto-Garcia, MD, MPH
Updated on July 22, 2026

Key takeaways:

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

  • Bactrim can cause side effects like upset stomach and diarrhea. Avoid spicy, acidic, and greasy foods while taking Bactrim because 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 that can treat several infections from urinary tract infections (UTIs) to skin, lung, and gut infections. 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. 

There aren’t any foods you need to avoid while taking Bactrim to make sure the medication works properly. But Bactrim can cause an upset stomach. Limiting foods that can irritate your stomach may help you feel more comfortable while taking this antibiotic. Let’s look at some of the foods and drinks to avoid or limit while taking Bactrim. 

1. Acidic foods

Bactrim is absorbed quickly in your gut, so it works well whether you take it with or without food. But it can sometimes irritate your stomach and cause nausea or stomach discomfort. Acidic foods can make this irritation worse, especially if your stomach is already sensitive.

If you notice that acidic foods bother your stomach, it may help to limit them while taking Bactrim.

2. Alcohol

It’s safest to avoid alcohol when you’re taking antibiotics. Most antibiotics, including Bactrim, can cause nausea or diarrhea. Adding alcohol to the mix can worsen those side effects.

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

Signs of a disulfiram-like reaction include:

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 avoiding alcohol while taking Bactrim. 

3. Bananas and other potassium-rich foods

The trimethoprim component of Bactrim can make it harder for your kidneys to remove potassium from your body. This can raise potassium levels in your blood. 

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

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 before starting Bactrim if you have kidney problems or take medications that increase your potassium levels.

4. Caffeine

Caffeine doesn’t have a strong interaction with Bactrim, so you don’t need to avoid it completely. But it’s not a good idea to increase how much you drink while taking the medication.

Caffeine can make you urinate more often, which may lead to dehydration. For most people, this isn’t enough to cause dehydration. But if you’re already at risk for dehydration because you have a fever or aren’t eating and drinking much, it’s better to focus on other fluids to help stay hydrated.

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. In some people, Bactrim can cause crystals to form 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 your gut. Whole grains, fruits, and legumes are a good source of prebiotics, which 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, this 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. Dairy products with probiotics, like yogurt or kefir, 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’re sick and don’t feel like eating much. 

Yes, you can take Bactrim on an empty stomach. But keep in mind that Bactrim can cause nausea or an upset stomach. Taking it with food and a full glass of water may help reduce these side effects.

The bottom line

Bactrim is absorbed very quickly, so you don’t have to worry about foods and drinks making it less effective. But like with 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 also recommend avoiding alcohol while taking Bactrim. Drinking alcohol while taking Bactrim can increase your 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.

References

Dietary Guidelines for Americans. (2019). Food sources of potassium

Eumedica Pharmaceuticals GmbH. (2023). Bactrim tablets, sulfamethoxazole and trimethoprim [package insert]

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