How is whooping cough treated? It's a bacterial infection, so it can be treated with antibiotics, usually erythromycin or a family of antibiotics like erythromycin. Erythromycin is taken for 2 weeks. If antibiotics are recommended, they should take all the doses and finish the recommended course.