Drugs That Prevent Opportunistic Infections in HIV

Medically Reviewed by Jonathan E. Kaplan, MD on April 25, 2022
8 min read

When you have HIV/AIDS, you’re at higher risk of infections your body would normally be able to fight off. They can also be more severe, more frequent, or both. These infections are called opportunistic infections.

The risks are higher if you have very low levels of CD4 T cells. These are white blood cells that fight infection. The more severe your HIV infection, the lower your CD4 levels get, and the weaker your immune response to invaders. If your CD4 cells drop below 200, that means your HIV infection has progressed to the most severe phase called AIDS.

Fortunately, with the rise of antiretroviral therapy (ART) for HIV in the 1990s, opportunistic infections have gone down significantly. ART does a very good job of getting your CD4 levels back up. But some people may not respond well to ART and need additional protection from infection. And some germs and viruses find ways to cause infection even when you have high CD4 counts.

The most important things you can do to prevent opportunistic infections are to:

  • Start taking ART as soon as possible after you are diagnosed with HIV
  • Take your ART medicines every day
  • Follow up with laboratory tests to make sure your HIV remains undetectable

Your doctors may recommend additional treatments to help shield you from opportunistic infections, as well.

This is the first line of treatment for HIV and the No. 1 way to prevent opportunistic infections. Infections can happen in people who are getting ART, but it happens mostly in people who aren’t.

If you’re diagnosed with HIV early, when your CD4 count is still high, and you start ART right away, it’s possible that you’ll never develop an opportunistic infection.

If you’re diagnosed with HIV later, after the disease has already weakened your immune system, and you go to the doctor with an opportunistic infection, you’ll start taking medicine to fight the opportunistic infection right away. When you should start your ART regimen, however, depends on what opportunistic infection you have.

You can start ART right away, or within 2 weeks of most opportunistic infections, including:

In advanced HIV, the combination of ART and treatment for the opportunistic infection may cause dangerous side effects. So, you may need to wait 2 to 4 weeks to start ART if you have:

  • Meningitis, an inflammation of the membranes around the brain or spinal cord, which can happen as a result of an infection, for example with tuberculosis, toxoplasmosis, or the fungus cryptococcus
  • Any parasite that infects the central nervous system, such as T. cruzi
  • Bartonella (which causes cat scratch disease) in the eye or the central nervous system

In addition to protecting you by making your immune system stronger, some ART medicines also specifically work against other viruses. The ART drug tenofovir, for example, also works against hepatitis B virus (HBV). If you have both HIV and HBV, your ART regimen may include tenofovir.

While ART is the most effective way to protect yourself, it’s not a cure. Even after years of ART, after your CD4 levels have bounced back, your immune system remains affected by HIV. That’s why it’s important to know about other ways to prevent opportunistic infections.

Everyone with HIV should be screened for some opportunistic infections. You may need additional screenings if you’ve been exposed to certain infections (such as tuberculosis or sexually transmitted infections) or live in areas where some infections are more common.

Your doctor may screen you for:

  • Cervical cancer and anal cancer, both of which are caused by human papillomavirus (HPV). These screenings are done by pap smears of the cervix or the anus.
  • Syphilis. This sexually transmitted infection is common in people with HIV. Depending on your level of sexual activity, you may also be screened for gonorrhea and chlamydia.
  • Hepatitis A, B, and C. All are widespread but don’t always cause symptoms. Doctors screen for all of these infections. Vaccines are available to prevent two of them – hepatitis A and hepatitis B.
  • Tuberculosis. A bacteria called Mycobacterium tuberculosis causes this disease. It can live for years in the body without causing symptoms.
  • Toxoplasma gondii. This common parasite lives in infected cat feces and contaminated food. It can live in your body undetected.
  • Cryptococcus. This fungus is found in pigeon droppings. Doctors may screen for it if you have advanced HIV disease (AIDS).
  • Coccidioides. This fungus is native to certain parts of the southwestern U.S. and lives in the soil.
  • Trypanosoma cruzi. This parasite is most common in rural parts of Latin America. It causes Chagas disease.

It’s especially important for people with chronic conditions like HIV to get all recommended vaccines, including COVID vaccines and a yearly flu shot. Respiratory diseases, such as pneumonia caused by pneumococcal bacteria, are especially common and dangerous to people with HIV. Pneumococcal disease can be prevented by vaccination. All people with HIV, if not already immune, should be vaccinated against hepatitis A and hepatitis B. A vaccine is now available to prevent shingles, which is caused by the same virus that causes chickenpox.

Take caution with live vaccines like MMR, chickenpox (not the same as the shingles vaccine), or the nasal spray vaccine for the flu. Live vaccines use a weakened form of a virus to give you immunity. When you have HIV, your body is at risk of getting an infection even with the weakened version of a virus. If your CD4 counts are high enough, these may be safe, but you’ll need to talk with your doctor first.

HIV can weaken your body’s response to vaccines, so early detection of HIV is key so that you can get vaccinated before your CD4 cell count drops too low.

Certain antibiotic medicines can be used to prevent some common opportunistic infections in people with HIV/AIDS.

However, your doctor will consider the risks and benefits of antibiotics for preventing infection in your situation. Antibiotics can lead to drug resistance, and they can disrupt the balance of the microbes in your gut, which can increase your risk for certain gastrointestinal infections.

Antibiotics to prevent tuberculosis (TB). Latent (inactive) TB infections are common and dangerous to someone diagnosed with HIV. As CD4 counts drop, a latent TB infection can reactivate.

A latent TB infection is diagnosed by a tuberculin skin test (TST, sometimes called a PPD) or by a blood test. Doctors often combine isoniazid and rifamycin antibiotics in a “drug cocktail” to prevent latent TB from turning into active TB. Your doctor may also start this treatment if you have been exposed to someone with active TB, even if you don’t test positive for latent TB.

Rifamycin antibiotics can interfere with ART. If you’re already on ART and are diagnosed with latent or active TB, your doctor may either change your ART drugs or use an alternative drug to treat your TB. Your doctor may need to tweak your regimen to make sure both treatments are working safely and effectively and monitor you to keep an eye on any toxic side effects. Rifamycin antibiotics can also lead to drug resistance fairly quickly, so you usually take them in combination with other drugs.

Trimethoprim-sulfamethoxazole (TMP-SMX). If your CD4 counts are below 200 cells, which means your HIV infection has progressed to AIDS, your doctor may use TMP-SMX to protect against a fungal pneumonia called pneumocystis pneumonia (PCP). You may also be advised to take TMP-SMX if you have a history of thrush, which is a fungal infection in your mouth and throat caused by the yeast candida albicans.

TMP-SMX also protects against lots of other diseases. These include:

  • Toxoplasmosis. This is caused by T. gondii, the most common central nervous system infection in people with AIDS. This parasitic infection can live undetected and reactivate when CD4 levels drop.
  • Some common respiratory bacteria, including those that cause pneumonia.
  • Cystoisosporiasis. This is a chronic debilitating illness caused by the parasite Cystoisospora belli. It’s rare and mostly lives in contaminated water in tropical areas, but it can cause severe gastrointestinal distress in people with HIV/AIDS.

If you’ve had PCP before, you may need to take TMP-SMX long-term to prevent it from coming back.

Some people have a bad reaction to TMP-SMX and need an alternative antibiotic medicine. Dapsone is a good alternative antibiotic for people allergic to TMP-SMX.

You will stay on TMP-SMX, or an alternative, until your CD4 levels go back up, and restart the medicine if they ever drop back down.

Antibiotics to prevent MAC. Germs from the Mycobacterium avium complex, or MAC, are related to the bacteria that causes tuberculosis. These germs are commonly found in soil, food, and water and are dangerous for people with weak immune systems.

MAC diseases happen in up to 40% of people with advanced HIV who are not taking ART. Preventing MAC disease is only recommended if you have a very low CD4 count (less than 50), aren’t taking ART, or your ART is not working.

Antibiotic drugs used to prevent MAC disease include:

Your doctor will want to choose your drug regimens carefully. You will get this treatment until your CD4 counts go back up.

Immune globulins. If you haven’t had chickenpox and you haven’t been vaccinated for it, you may be given preventive medicines if you have contact with someone who has chickenpox. Your doctor will give you an immune globulin that can protect you after being exposed by directly giving you the antibodies against chickenpox. This is different from a vaccine, which uses pieces of a germ to make your body develop those antibodies itself.

Preventive drugs can be used in two key ways: preventing first-time infections (primary prophylaxis) and preventing infections from coming back (secondary prophylaxis).

In people with AIDS, serious fungal infections (like cryptococcal disease) or viral infections (like cytomegalovirus) often come back, so you may have to take secondary prophylaxis for a long time after an initial infection. This will depend on your CD4 count and the type of infection.

The herpes virus can also come back, so you may take “suppressive therapy” long term with an antiviral drug such as acyclovir or valacyclovir after a herpes infection.