Question: I brought my child to shul and he was making a noise disturbing others during shemone esrei. Was I allowed to take him out while I was davening?
Answer: The Mishna (Berachos 30b) writes that one may not interrupt while davening shemone esrei even if the king asks them about their welfare or if a snake is on their leg. The Gemara (Berachos 32b) and poskim (Tosafos, Berachos 33b; Shulchan Aruch OC 104:3) explain that we’re not referring to dangerous situations – thus the Mishna refers to a Jewish king and a harmless snake.
The Vilna Gaon (Biur Hagra OC 104:3) writes that there is a machlokes as to whether moving constitutes an interruption. According to Rabbeinu Yona (Berachos 21a) and the Rema (OC 104:3) moving wouldn’t be considered to be an interruption while according to the Rosh it would be and so one mustn’t move unless they’re in danger.
The Magen Avraham (OC 104:3) and Mishna Berura (Biur Halacha 104:3) write that while one shouldn’t move without reason, it is okay to move if absolutely necessary, even without being in danger.
Thus, the Mishna Berura (104:1) writes that if one is distracted by a child while davening shemone esrei, they should first try to quietly motion to them (See Aruch Hashulchan OC 104:4). Failing that, they can move elsewhere. Elsewhere, the Mishna Berura (96:4) writes that one shouldn’t begin davening with a young child in front of them as they will likely distract them.
R’ Yosef Shalom Elyashiv (Dirshu Mishna Berura 104:n3) held that if the child is disturbing others in shul, they must be removed. R’ Benzion Abba Shaul (Ohr Lezion 2:35:31) adds that it is better for a parent to stay home to daven with their child rather than bring them to shul if they may disturb.
In conclusion, one should only bring children to shul if one believes that they won’t disturb. In the unlikely event that they disturb, their parents can remove them even during their shemone esrei.