According to the majority of scholars, women in their period are not to spend time in the mosques (the two Sacred Mosques included). However, some scholars consider it permissible for her to do so.
Sheikh Ahmad Kutty, a senior lecturer and Islamic scholar at the Islamic Institute of Toronto, Ontario, Canada, states:
While the majority of imams and scholars are of the opinion that women in their period are not to spend time in the mosques (the two Sacred Mosques included), some scholars consider it permissible for her to do so. According to the latter, the traditions cited by the former in this regard are considered either too weak or contradicted by other traditions and practices of the Prophet (peace and blessings be upon him). It is an acceptable principle of jurisprudence that when various proofs contradict, the original rule of permission should be upheld.
Even those scholars who do not allow menstruating women to enter or stay inside the mosque consider it permissible for her to do so should there be a need for her to do so; while there are others who find nothing wrong for her to do so if there is no fear of soiling or dirtying it. Thus Imam Abu Hanifah and others do permit them to enter the Sacred Mosque for Tawaf should they need to do so. The scholars of Shafi`i school do not consider it wrong for them if they take the necessary safeguards.
Imam Ibn Taymiyyah goes a step further when he considers it permissible in case of any need or purpose; visiting the Prophet’s grave or attending an educational lecture or service, etc. can all be included in this category.
Now coming to the issue of women making Tawaf in a state of menstruation, the authentic view on this issue can be summed up as follows:
If she can possibly wait in Makkah until such time that her menses stops and she purifies herself, then she should delay her Tawaf to perform it later. If, however, she has no choice but return home as the group she has traveled with is returning, then she is allowed to perform Tawaf while still menstruating. In this case, her Tawaf is considered valid, and there is no need for her to offer a fidyah (expiation) applicable to ihram violations.
This view has been put forward by Imam Ibn Taymiyyah after a detailed study of the sources, and it is considered authentic and in full conformity with the principles of Islamic jurisprudence.