In some cases, pyloric stenosis may be passed down through families (inherited), or a baby may have the problem as part of another genetic condition.
Antibiotics, such as erythromycin, given
to a baby within the first 2 weeks of life may slightly increase his or her chances for developing pyloric stenosis. But it is very unlikely that taking antibiotics would by itself cause pyloric stenosis.
In the past, pyloric stenosis was considered a birth defect.