Rota–Baxter algebras are important in probability, combinatorics, associative Yang–Baxter equation and splitting of algebras. This paper studies the formal deformations of Rota–Baxter algebra morphisms. As a consequence, we develop a cohomology theory of Rota–Baxter algebra morphisms to interpret the lower degree cohomology groups as formal deformations. Finally, we prove the cohomology comparison theorem of Rota–Baxter algebra morphisms, i.e. the cohomology of a morphism of Rota–Baxter algebras is isomorphic to the cohomology of an auxiliary Rota–Baxter algebra.