For much of the twentieth century, erythromycin was the standard antibiotic for treating and preventing pertussis, the disease known as whooping cough. Then, in the late 1990s and early 2000s, a series of careful epidemiological studies uncovered a troubling association between erythromycin given to very young infants and a condition called infantile hypertrophic pyloric stenosis, a blockage at the outlet of the stomach that can leave a newborn unable to keep down feeds. That finding, together with clinical trial evidence that azithromycin worked just as well against pertussis with a shorter course and gentler side-effect profile, prompted pediatric guideline bodies to shift their first-line recommendation. This article traces that evidence carefully: what erythromycin's risk actually looked like, how strong the studies were, and why azithromycin now holds the preferred place in treating this dangerous infection in the youngest and most vulnerable patients.

A Disease That Still Threatens Infants

Pertussis is not a nuisance illness in early infancy. Caused by the bacterium Bordetella pertussis, it produces a cough illness that in older children and adults is unpleasant but rarely dangerous. In infants under six months, particularly those too young to have completed their DTaP vaccine series, it is a different disease entirely. The classic paroxysmal cough may be absent; instead, small infants can present with apnea, cyanotic spells, feeding difficulty, and in the most severe cases, pneumonia, seizures, and death. Public health data from the CDC have consistently shown that pertussis deaths in the United States are concentrated almost entirely in infants younger than three months. Treating and preventing this infection promptly in newborns and their household contacts is not a matter of convenience; it is a matter of protecting a life that cannot protect itself. That urgency is precisely why the choice of antibiotic in this age group carries such weight.

Erythromycin's Long Service — and a Mechanistic Clue

Erythromycin was isolated in 1949 from a soil-dwelling actinomycete, Streptomyces erythreus, found in a sample collected in the Philippines. It became one of the great early alternatives to penicillin, and for decades it was the standard treatment and post-exposure prophylaxis for pertussis in patients of every age, including newborns. It works well against B. pertussis, and its long track record made it the default choice.

Erythromycin has a well-documented secondary property, though: it stimulates motilin receptors in the gut, which increases gastric and antral smooth-muscle contraction. This is precisely why erythromycin has long been used off-label in some settings as a prokinetic agent for feeding intolerance. Pediatric researchers began to ask whether this same motilin-agonist effect, acting on the immature and still-developing pyloric muscle of a newborn, could plausibly encourage the kind of smooth-muscle overgrowth seen in pyloric stenosis. This was, and remains, a biologically plausible hypothesis rather than a fully proven mechanism — but it gave researchers a reason to look closely at the epidemiological data rather than dismiss an odd pattern as coincidence.

What the Studies Actually Showed

Infantile hypertrophic pyloric stenosis (IHPS) is a condition in which the pyloric muscle thickens enough to obstruct the stomach outlet, typically presenting between two and eight weeks of age with forceful, non-bilious vomiting. It occurs in roughly one to three of every 1,000 live births in Western populations, more often in firstborn males, and it has a known genetic and familial component independent of any drug exposure. Because it is uncommon and multifactorial, detecting a drug-associated increase in risk required large population-based studies rather than a handful of case reports.

Two lines of evidence proved most influential:

Danish national registry research around the same period examined maternal and infant macrolide exposure using the country's comprehensive birth and prescription registers and found a comparable pattern: risk concentrated in direct, very early postnatal exposure, with the association for maternal use during breastfeeding weaker and less consistent. Taken together, these were observational studies — cohort and case-control designs drawn from real-world prescribing and outcomes data, not randomized trials — but they were large, used independent data sources in different countries, and converged on the same narrow window of vulnerability. That kind of independent replication is what gives an observational signal real weight in pharmacovigilance, even without a randomized trial, which would be neither ethical nor practical to run for this question.

It is worth being precise about what these studies did and did not show. They demonstrated an association concentrated in the first one to two weeks of life, not a general hazard of erythromycin at any age. The absolute risk increase, while real, remained modest in absolute terms because baseline IHPS incidence is low; the studies were powered to detect relative risk because absolute numbers of affected infants were small. No study proved the motilin mechanism was the actual cause, and IHPS clearly has causes unrelated to any medication. What the data supported was a cautious, evidence-based recommendation to avoid unnecessary erythromycin exposure in the newborn period when a comparably effective alternative exists.

Azithromycin: Comparable Efficacy, Different Profile

Azithromycin is a semi-synthetic macrolide, chemically modified from erythromycin's core structure to improve tissue penetration, extend its half-life, and reduce gastrointestinal stimulation. Its motilin-receptor activity is markedly weaker than erythromycin's, which offered a plausible reason to expect a lower pyloric stenosis signal, though it is worth noting azithromycin's use in neonates has not accumulated the same decades-long volume of exposure data as erythromycin, so ongoing pharmacovigilance still matters.

The efficacy case for azithromycin came from direct clinical comparison. A randomized controlled trial conducted through the Pediatric Investigators Collaborative Network on Infections in Canada, led by Langley and colleagues and published in Pediatrics in 2004, compared a short, five-day course of azithromycin against a longer erythromycin regimen for pertussis in children. The trial found azithromycin achieved bacteriologic clearance of B. pertussis from the nasopharynx at rates statistically equivalent to erythromycin, while producing fewer gastrointestinal side effects and better treatment adherence — an important practical consideration, since a difficult-to-tolerate antibiotic that a caregiver cannot get a sick infant to finish provides no protection at all.

On the strength of the pyloric stenosis studies and this efficacy data, the CDC's pertussis treatment guidance, and subsequently the American Academy of Pediatrics' Red Book, moved to recommend azithromycin as the preferred agent for pertussis treatment and post-exposure prophylaxis in infants younger than one month, and as the preferred agent more broadly across pediatric ages, with erythromycin retained mainly as an alternative when azithromycin cannot be used. This is a guideline recommendation for a specific indication and age group; it is not a claim that erythromycin is unsafe in all settings or all patients, and azithromycin use in any infant remains a decision for a physician to make with the family, not a blanket substitution parents should attempt to direct themselves.

What This Means for Families Today

This episode is a good example of pharmacovigilance working as intended: independent researchers in different countries, using large real-world datasets, noticed a pattern, tested it rigorously, and clinical guidelines adjusted in response — not because of alarm, but because the data, examined honestly, supported a safer path for newborns. It also illustrates why decisions about a newborn's medication deserve the same care as any other decision made on behalf of a life that cannot yet speak for itself. Parents facing a pertussis diagnosis or exposure in their household should feel free to ask their pediatrician directly why azithromycin is being recommended, what the alternatives are, and what to watch for — projectile vomiting, poor weight gain, or signs of dehydration in the weeks after any antibiotic course warrant a call to the doctor regardless of which drug was used.

Vaccination remains the most reliable protection against this disease for the infants most at risk: the CDC and AAP recommend a Tdap dose during each pregnancy, ideally between 27 and 36 weeks, so maternal antibodies pass to the infant before birth, alongside the standard DTaP schedule and "cocooning" — making sure everyone in close contact with a newborn is current on pertussis vaccination. Antibiotic choice matters when pertussis does occur, but preventing exposure in the first place remains the stronger form of stewardship.

Key Takeaway

Careful, independently replicated observational research tying erythromycin to a higher risk of pyloric stenosis in very young infants, combined with trial evidence that azithromycin treats pertussis just as effectively with fewer side effects, is why pediatric guidelines now favor azithromycin for this vulnerable age group — a change parents can discuss confidently with their own physician.