The devil is intent on destroying the Church, setting many traps for her followers, as well as her leaders. This is one of the reasons why Pope Leo XIII composed a prayer to St. Joseph for the protection of the Church.
He composed the prayer at the end of Quamquam pluries, asking the faithful to call on St. Joseph for protection against the devil.
The prayer recalls St. Joseph's protection of the Child Jesus in Egypt and asks for his intercession, that the Church may be spared from the devil's vicious attacks.
Defend, O most watchful guardian of the Holy Family, the chosen offspring of Jesus Christ. Keep from us, O most loving Father, all blight of error and corruption. Aid us from on high, most valiant defender, in this conflict with the powers of darkness. And even as of old thou didst rescue the Child Jesus from the peril of His life, so now defend God's Holy Church from the snares of the enemy and from all adversity. Shield us ever under thy patronage, that, following thine example and strengthened by thy help, we may live a holy life, die a happy death, and attain to everlasting bliss in Heaven. Amen.