Our data reveal targeting RORγt and IL-17A pathways may offer a promising therapeutic strategy for bacterial infections in neonatal populations. Here, IL17A is linked to bacterial infectious disease.