The detrimental effects of hyperthermia on the testes and the protective effect of thyme essential oil against testicular damage induced by this stress in rams were studied. Twenty‐four rams of the Barbarine breed with an average weight of 62.5 ± 0.3 kg and an average age of 24 ± 0.6 months. The experiment consisted of inducing localized heat stress on the first group of rams by applying heat bags to both testicles of six rams (G s). The second group underwent the same heat stress on the testes but received orally 100 µL/day/animal of thyme essential oil (G s‐he). A positive control did not undergo stress but received thyme essential oil (G he) with the same doses as the (G s‐he) group, and the negative control did not undergo either stress or receive the essential oil of thyme (G c). One hundred twenty‐eight adult ewes of the same breed divided into four groups of 32 ewes were used to study the effect of different treatments on the in vivo ram's fertility. Ewes are synchronized and we have applied natural mating with oestrus control, the reproduction balance sheet is calculated after lambing. The results showed that tests of heat stress (HS) negatively affect semen quality but did not cause infertility. However, neither tests for heat stress nor treatment with thyme EO significantly affected the haematological profile. The study of the effect of heat stress on the testes on fertility in vivo showed a drop in the number of females who were fertilized at the first oestrus and consequently a drop in fertility. However, the rams that suffered the same stress but were treated with EO thymus recorded an improvement in these parameters.