Skip to main content
IDF logo
Woman taking a pill while holding a glass of water.

Preventative antibiotics and other antimicrobials

Key points: 

  • Antimicrobial prophylaxis is when healthcare providers use antibiotics or other germ-fighting medications to prevent, instead of treat, infections.
  • Healthcare providers generally use antimicrobial prophylaxis in people with primary immunodeficiency (PI) who either are not on immunoglobulin (Ig) replacement therapy or who continue to have infections despite Ig replacement therapy.
  • The medications prescribed for prophylaxis depend on the type of PI a person has and their infection history.
  • Different types of medications work against different types of germs; antibiotics prevent bacterial infections, antifungals prevent mold and yeast infections, and antivirals prevent viral infections.

Healthcare providers sometimes prescribe antibiotics and other antimicrobials, like antiviral and antifungal medications, to keep people with primary immunodeficiency (PI) from getting infections, instead of to treat infections they already have. This type of treatment is also known as antimicrobial prophylaxis.

Healthcare providers most often prescribe these medicines for people with PI who are either not on immunoglobulin (Ig) replacement therapy or who have breakthrough infections on Ig replacement therapy. Healthcare providers may also prescribe these medicines temporarily for others with PI before they travel, during dental work or surgery, or during cold and flu season. 
The goal of antimicrobial prophylaxis is to prevent infections and any problems they cause that could lead to permanent organ damage. The types of germs that tend to cause infections in specific types of PI help healthcare providers decide which antimicrobials to prescribe.

Most of what healthcare providers know about how well prophylactic antimicrobials work for treating PI comes from treating other long-term illnesses, like cystic fibrosis, human immunodeficiency virus (HIV), and chronic obstructive pulmonary disease (COPD).

A survey by the Immune Deficiency Foundation in 2023 found that 18% of patients received prophylactic antimicrobials at some point during their treatment. At the time of the survey, 16% of patients were taking prophylactic antibiotics, and 7% were taking prophylactic antifungals. Other studies have reported that up to 50% of PI patients are on prophylactic antibiotics, especially those with antibody deficiencies [2].

Antibiotics

Antibiotics are medications that kill bacteria or stop them from growing. They are the most common type of antimicrobials used to prevent infections in those with PI [1].

Bacteria can have two different types of cell walls, either gram positive or gram negative. These terms describe the cell wall structure, and this structure determines which antibiotics will work against a particular type of bacteria. There are more kinds of antibiotics available that work against gram-positive bacteria than gram-negative bacteria. Because of differences in how gram-negative bacteria function, they are naturally resistant to some types of antibiotics that work on gram-positive bacteria.

Healthcare providers use prophylactic antibiotics for people with antibody deficiencies such as common variable immunodeficiency (CVID), X-linked agammaglobulinemia (XLA), selective IgA deficiency, and specific antibody deficiency (SAD). They also use them for people with other PIs, like chronic granulomatous disease (CGD). For SAD, studies support using prophylactic antibiotics first and then Ig replacement therapy if breakthrough infections occur [3]. For CGD, antibiotics may be used along with other preventative medications.

Generally, if a person on Ig replacement therapy has more than three breakthrough infections a year, has very serious infections, or has organ damage such as chronic lung disease, then an immunologist might consider adding prophylactic antibiotics to their treatment regimen. How often someone takes the prophylactic antibiotic can range from every day to a few times a week, depending on the type of bacteria that tends to cause infection and the antibiotic. The dose of the prophylactic antibiotic is usually lower than the dose healthcare providers would use to treat an active infection.

Penicillins are a class of antibiotics that includes penicillin, amoxicillin, and combinations of penicillins with other drugs that help them work better, such as amoxicillin-clavulanate (trade name Augmentin). They are well tolerated long term and protect against Streptococcus pneumoniae and other common gram-positive bacteria that cause pneumonia, ear infections, and sinusitis. They may also be used to prevent infection when undergoing treatment for gum disease.

Penicillin can cause allergic reactions such as diarrhea, rash, or anaphylaxis (rapid heartbeat, low blood pressure, and difficulty breathing), which is a medical emergency. If you experience these symptoms, it’s important to get tested for penicillin allergies as well as getting medical attention. Healthcare providers test for penicillin allergy by putting a small dose of penicillin in the skin with a needle and looking for red, itchy bumps or by giving five doses of penicillin, starting with a small dose and increasing it to see if there is a reaction. Note that many people with a reported allergy to penicillin are not found to be allergic through testing [4].

Trimethoprim-sulfamethoxazole (TMP-SMX; trade names Bactrim, Septra) is mostly prescribed for people with CGD and Wiskott-Aldrich syndrome (WAS). It is very well tolerated long term and doesn’t cross-react with other antibiotics. It protects against some methicillin-resistant Staphylococcus aureus (MRSA), a gram-positive bacteria, and the gram-negative Serratia marcescens and Burkholderia cepacia complex bacteria. One study found that prophylactic TMP-SMX decreased non-fungal infections in CGD by up to one third [5].

TMP-SMX also acts as an antifungal against pneumocystis pneumonia (PCP), a severe lung infection caused by the fungus Pneumocystis jirovecii. Dosing to prevent bacterial infections is typically higher than dosing to prevent Pneumocystis infections.

TMP-SMX can cause allergies, but an allergist can help a person become less sensitive to it. Rarely, it can cause blood disorders if it’s used at high doses or liver problems.

Azithromycin (trade names Zithromax, Zmax, Z-Pak) is well tolerated and good at preventing chronic sinus infections. It protects against gram-positive Streptococcus spp. and gram-negative Haemophilus influenzae. It works especially well against Mycobacterium spp., which are gram-positive bacteria that live in the soil and cause infections in people with certain PIs such as CGD. Azithromycin has also been shown to have anti-inflammatory properties in patients with cystic fibrosis and chronic obstructive lung disease [6], and helps prevent worsening of bronchiectasis.

A 2019 study showed that people with antibody deficiencies who had chronic, infection-related lung disease had positive results with azithromycin prophylaxis [7]. Those treated had a lower risk of symptoms getting worse, improved quality of life and lung function, lower risk of hospitalizations, and needed fewer additional antibiotics.

Side effects from azithromycin include nausea and diarrhea. In rare cases, it can cause heart rhythm problems such as a prolonged QT interval. People with an irregular heartbeat or other risk factors for heart arrhythmias should not use azithromycin or other antibiotics in the same class, known as macrolide antibiotics, and those on macrolides long term should be monitored for an irregular heartbeat [8].

Another problem with azithromycin is that the gram-positive bacteria Streptococcus pneumoniae and Staphylococcus aureus can easily become resistant to it.

Erythromycin and roxithromycin are two other prophylactic antibiotics commonly prescribed for chronic sinusitis. They prevent infections caused by gram-positive bacteria like Staphylococcus aureus and Streptococcus pneumoniae and gram-negative bacteria like Haemophilus influenzae and Moraxella catarrhalis.

Antifungals

Antifungals are medicines that kill fungi or stop them from growing. Fungi can either be molds or yeasts. Fungal infections most often affect the skin, hair, and nails.

Antifungals are different from antibiotics because they treat fungal infections, not bacterial infections. There are fewer types of antifungals than there are antibiotics.

Some people with PI, especially those with CGD, have a high risk for both bacterial and fungal infections and can develop pneumonia, liver abscesses, bone infection, and inflammation. Healthcare providers might add an antifungal if a person has a history of fungal infections or a type of PI that makes them more likely to develop fungal infections. Most antifungals interact with other medications, so be sure to discuss all your medications and supplements with your prescriber.

Itraconazole protects against yeast like Candida spp. and some molds like Aspergillus spp., especially in CGD. This medicine works better if taken with something acidic like oranges. It can interact with other medications such as prednisone, so caution is advised when they are used together.

Voriconazole is stronger than itraconazole and protects against yeast like Candida spp. and molds like Aspergillus spp. It can cause sun sensitivity, lead to skin cancer, and increase fluoride levels, so healthcare providers try to limit prophylactic use of this drug.

Posaconazole is similar to voriconazole and is sometimes preferred because it doesn’t cause sun sensitivity or elevated fluoride levels. However, rarely, it can affect the liver and interact with prednisone.

Fluconazole protects against yeast infections such as vaginal yeast infection, oral thrush, urinary tract infections, and other Candida spp. infections.

Antivirals

Antiviral medications can reduce the risk of infection from certain viruses, but not all viruses, and are not effective against bacteria or fungi. Unlike an antibiotic that protects against several different types of bacteria, antivirals only work against one or a small family of viruses. A virus lives inside cells, unlike most bacteria, making viruses more difficult to target without damaging the cell. There are more viruses than there are drugs to treat them. Most viruses do not have good antivirals.

Acyclovir is good at preventing infection from the herpes simplex virus, which causes cold sores or genital herpes, and the varicella-zoster virus, which causes shingles and chickenpox. The drug is very well tolerated and people can be on it for many years. It is often used for those with T cell deficiencies, like severe combined immunodeficiency (SCID) and combined immunodeficiencies (CID), such as GATA2 and DOCK8 deficiency.

Like acyclovir, valacyclovir is good at preventing infection from the herpes simplex virus and the varicella-zoster virus, and is well tolerated. It is also used for those with T cell deficiencies.

Oseltamivir (trade name Tamiflu) can be used as a prophylaxis for infection from the influenza virus.

What are the risks of using preventative antimicrobials?

One risk is antimicrobial resistance [9]. Antimicrobial resistance means that a particular medicine no longer works for a germ that it used to be effective against. When someone has an infection that is resistant to antimicrobials, it is the germs themselves that ‘resist’ the drug, not the person’s body.

Germs that become resistant to antimicrobials have changed genetically over time so that they are less and less affected by a particular drug or class of drugs. Antimicrobial resistance is basically an evolutionary survival mechanism for germs.

People with PI who are on prophylactic antimicrobials are particularly at risk of developing antimicrobial-resistant infections because all of the bacteria, fungi, and other germs in their body (known as their microbiome) are constantly exposed to these medicines. Non-harmful germs that develop resistance can then pass that resistance on to infection-causing germs, helping them survive. Not only can these drugs become less effective as preventative measures, but resulting infections can be harder to treat.

To prevent antimicrobial resistance, antimicrobials should be used as prescribed, and only an immunologist can determine if prophylactic antimicrobials are appropriate.

Other risks of antimicrobial prophylaxis include side effects like:

  • Nausea, vomiting, diarrhea.
  • Changes to a person’s microbiome that increase the risk of Clostridium difficile (C. diff) [10] and Candida spp. (thrush) infections [11].
  • Liver problems.
  • Allergies, including anaphylaxis.

Whether probiotics can help with side effects like diarrhea and nausea should be discussed with your immunologist. Ongoing research suggests probiotics can be helpful [12], but factors like age, health, and genetics should be considered, especially for those who are immunocompromised. Since probiotics are live bacteria, it is important to discuss the specific probiotic you are considering and its ingredients with your immunologist.

  1. 2023 National Patient Survey. In: Immune Deficiency Foundation [Internet]. [cited 15 Jan 2026]. Available: https://primaryimmune.org/advancing-pi-research-and-clinical-care/idf-surveys/2023-national-patient-survey.
  2. Hernandez-Trujillo HS, Chapel H, Lo Re V 3rd, Notarangelo LD, Gathmann B, Grimbacher B, et al. Comparison of American and European practices in the management of patients with primary immunodeficiencies: ESID practices in PID. Clin Exp Immunol. 2012;169: 57–69. Available: https://pmc.ncbi.nlm.nih.gov/articles/PMC3390474/
  3. Smits BM, Kleine Budde I, de Vries E, Ten Berge IJM, Bredius RGM, van Deuren M, et al. Immunoglobulin replacement therapy versus antibiotic prophylaxis as treatment for incomplete primary antibody deficiency. J Clin Immunol. 2021;41: 382–392. Available: https://link.springer.com/article/10.1007/s10875-020-00841-3
  4. Borch JE, Andersen KE, Bindslev-Jensen C. The prevalence of suspected and challenge-verified penicillin allergy in a university hospital population. Basic Clin Pharmacol Toxicol. 2006;98: 357–362. Available: https://onlinelibrary.wiley.com/doi/10.1111/j.1742-7843.2006.pto_230.x
  5. Margolis DM, Melnick DA, Alling DW, Gallin JI. Trimethoprim-sulfamethoxazole prophylaxis in the management of chronic granulomatous disease. J Infect Dis. 1990;162: 723–726. Available: https://academic.oup.com/jid/article-abstract/162/3/723/823625?redirectedFrom=fulltext&login=true
  6. Cogen JD, Onchiri F, Emerson J, Gibson RL, Hoffman LR, Nichols DP, et al. Chronic azithromycin use in cystic fibrosis and risk of treatment-emergent respiratory pathogens. Ann Am Thorac Soc. 2018;15: 702–709. Available: https://pmc.ncbi.nlm.nih.gov/articles/PMC6850787/
  7. Milito C, Pulvirenti F, Cinetto F, Lougaris V, Soresina A, Pecoraro A, et al. Double-blind, placebo-controlled, randomized trial on low-dose azithromycin prophylaxis in patients with primary antibody deficiencies. J Allergy Clin Immunol. 2019;144: 584–593.e7. Available: https://www.jacionline.org/article/S0091-6749(19)30388-4/fulltext
  8. Ray WA, Murray KT, Hall K, Arbogast PG, Stein CM. Azithromycin and the risk of cardiovascular death. N Engl J Med. 2012;366: 1881–1890. Available: https://www.nejm.org/doi/full/10.1056/NEJMoa1003833
  9. Karabiber E, Ilki A, Gökdemir Y, Vatansever HM, Olgun Yıldızeli Ş, Ozen A. Microbial isolates and antimicrobial resistance patterns in adults with inborn errors of immunity: A retrospective longitudinal analysis of sputum cultures. Int Arch Allergy Immunol. 2025;186: 387–398. Available: https://karger.com/iaa/article/186/4/387/914789/Microbial-Isolates-and-Antimicrobial-Resistance
  10. Seekatz AM, Young VB. Clostridium difficile and the microbiota. J Clin Invest. 2014;124: 4182–4189. Available: https://www.jci.org/articles/view/72336
  11. Gutierrez D, Weinstock A, Antharam VC, Gu H, Jasbi P, Shi X, et al. Antibiotic-induced gut metabolome and microbiome alterations increase the susceptibility to Candida albicans colonization in the gastrointestinal tract. FEMS Microbiol Ecol. 2020;96: fiz187. Available: https://academic.oup.com/femsec/article/96/1/fiz187/5643884
  12. Yang S, Qiao J, Zhang M, Kwok L-Y, Matijašić BB, Zhang H, et al. Prevention and treatment of antibiotics-associated adverse effects through the use of probiotics: A review. J Adv Res. 2025;71: 209–226. Available: https://www.sciencedirect.com/science/article/pii/S2090123224002303

This page contains general medical and/or legal information that cannot be applied safely to any individual case. Medical and/or legal knowledge and practice can change rapidly. Therefore, this page should not be used as a substitute for professional medical and/or legal advice. Additionally, links to other resources and websites are shared for informational purposes only and should not be considered an endorsement by the Immune Deficiency Foundation.

Adapted from the IDF Patient & Family Handbook for Primary Immunodeficiency Diseases, Sixth Edition 
Copyright ©2019 by Immune Deficiency Foundation, USA