In the development of deep shale oil and gas, the working temperature of the water-based drilling fluids is relatively high, which can cause wellbore instability due to the poor temperature resistance of the traditional environmental-friendly additives. To address this issue, this study presents a wellbore stabilizer called PMG, prepared by modifying gelatin (GT) with a resin synthesized by polyvinyl alcohol (PVA) and methacrylic acid (MA) through hydrothermal free radical polymerization, and it can withstand temperature up to 200 °C. The synthesis and thermal stability of PMG were confirmed by Fourier transform infrared spectroscopy (FT-IR) and thermogravimetric analysis (TGA). The wellbore stability performance of PMG was evaluated by linear swelling test, rolling recovery test, core immersion experiment and point load test and the wellbore stability mechanism was also investigated. The results reveal that the swelling height of sodium-based bentonite (Na-BT) in 2.0 % PMG solution at 150 °C is only 0.97 mm; the hot-rolling recovery rate in 2.0 % PMG solution at 200 °C is 72 %; the artificial core still maintains its original appearance after being immersed in 2.0 % PMG solution at 200 °C for 16 h, and the compressive strength increases by 12 %, effectively strengthening the wellbore. In addition, the EC50 value of PMG is > 106 mg/L, and the BOD5/CODcr value is 31 %, indicating that it is non-toxic and biodegradable. PMG has excellent wellbore stability performance, in addition to being able to adsorb on the surface of Na-BT by electrostatic action and hydrogen bonding, the PMG micelles that precipitated from the aqueous solution due to the breaking of hydrogen bonds in the molecular chain at high temperature also form a film on the clay surface, aggregating and cementing the clay particles together, further enhancing the wellbore stability.