In summary, this study shows that IL-17A could be used as an important indicator for assessing the bacterial infections of mammary glands, indicating that IL-17A could be regarded as one potential therapeutic target for mastitis. Here, IL17A is linked to bacterial infectious disease.