It is from the Sunnah that a man performs ghusl when he intends to enter ihram, and when he intends to enter Makkah.
من السنة أن يغتسل الرجل إذا أراد أن يحرم، وإذا أراد أن يدخل مكة.
No references are available.
Daraqutni (2433), Hakim (1/447), Bayhaqi (5/33), and Bazzar in Kashf Astar (1084) all narrated it through Sahl bin Yusuf, who said, Humayd narrated to us, from Bakr bin Abdullah, from Ibn Umar, and he mentioned it, except that the last of them did not mention entering Makkah. Hakim said, "Sahih according to the criteria of Bukhari and Muslim." I say, rather it is according to the criteria of Bukhari alone, for Sahl bin Yusuf, who is Anmati, was not narrated from by Muslim. Bakr bin Abdullah is Muzani, and Humayd is Ibn Abu Humayd Tawil. Ibn Umar's statement, "It is from the Prophet's practice," means it is attributed to the Prophet, as the majority of scholars have said that when a companion says, "It is from the Prophet's practice," what is meant is something attributed to the Prophet.On this subject there is also what was narrated from Ibn Abbas, who said, "The Messenger of Allah ﷺ performed ghusl, then put on his clothes. When he reached Zulhulayfa, he prayed two units of prayer, then sat on his mount. When it stood upright with him on Bayda, he entered ihram for Hajj."Daraqutni (2432) and Hakim (1/447), and from him Bayhaqi (5/33), narrated it from Yaqub bin Ata bin Abu Rabah, from his father, from Ibn Abbas, and he mentioned it. Bayhaqi said, "Yaqub bin Ata is not strong." I say, this is as he said, for Abu Zura, Nasai, Ibn Main, and others graded him daif. Ahmad said, "His hadith is objectionable," because what is sahih and established is that the Prophet ﷺ spent the night at Zulhulayfa, then in the morning performed ghusl and put on the ihram garments.The hadiths on this subject indicate that ghusl is prescribed for entering ihram, and it is a strongly emphasized practice according to the four imams and the majority of jurists. If one performs ablution instead of ghusl, there is no harm in that. As for the menstruating woman and the woman in postpartum bleeding, ghusl is more emphasized in their case than the ghusl of men and ritually pure women, though it is not obligatory. See Minna Kubra (3/538).