In this paper, we first introduce the concept of a Rota–Baxter operator on a cocommutative weak Hopf algebra H and give some examples. We then construct Rota–Baxter operators from the normalized integral, antipode, and target map of H. Moreover, we construct a new multiplication “∗” and an antipode SB from a Rota–Baxter operator B on H such that HB=(H,∗,η,Δ,ε,SB) becomes a new weak Hopf algebra. Finally, all Rota–Baxter operators on a weak Hopf algebra of a matrix algebra are given.