The World Federation One Stop Fiqh

Ruling 901

It is disapproved to give access to an insane person to enter a mosque, and similarly, to a child if it causes trouble for those performing prayers there or there is a probability that the child would make the mosque impure. Apart from these two reasons, there is no problem in allowing a child to enter a mosque; indeed, sometimes it is preferable to do so. Furthermore, if someone has eaten onions, garlic, or something similar, and his breath would thereby annoy people, it is disapproved for him to go to a mosque.