All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger.
It is desirable for whoever yawns during the prayer to try to overcome yawning and prevent it as the Prophet said: ''Yawning during the prayer is from the devil, so if any of you yawns, he should suppress it as much as he can.” [Muslim, Abu Daawood and At-Tirmithi]
Al-Mubaarak Poori said: “This means one should suppress it and hold it in by putting the hand over the mouth, or by clinching the upper and lower jaws and closing the lips tightly [i.e. closing the mouth]…”
Hence, it is desirable to put the hand over the mouth when yawning during the prayer in the same manner one does outside the prayer. The Prophet said: ''If any of you yawns during the prayer, let him put his hand over his mouth as the devil enters [i.e. the mouth of the person] due to yawning.”
Allaah Knows best.