In this paper we introduce the notion of $(f,\omega)$-compatible pair $(B,H)$, by which we construct a Hopf algebra in the category $^H_H$YD of Yetter-Drinfeld $H$-modules by twisting the comultiplication of $B$. We also study the property of $\omega$-smash coproduct Hopf algebras $B_{\omega}\bowtie H$.