Conservation of sandstone-based cultural heritage has attracted a great deal of interest. We propose herein a novel protecting strategy, via in situ fabrication of bentonite-based hydrogels (B-H) inside sandstones, where the bentonite-based hydrogels serve as the underlying cement. To create bentonite-based hydrogels with controllable structure, possessing good mechanical and anti-swelling properties, we have optimized forming time, appearance, and viscosity. The hydrogel precursor penetrated into the pores of the sandstone; the hydrogel would then form within 3−5 h. As found by employing a fluorescent tracer, the precursor remained controllably in place without any apparent change in the sandstone morphology. The bentonite-based hydrogels that formed inside the sandstones presented strong hydrogen bonding, coordination, and ionic bonding, as well as strong mechanical interlocking to the sandstone matrix. As a result, the sandstones possessed enhanced mechanical compressive strength and excellent resistance to acid, salt, and freeze−thaw cycles. Our approach provides for a non-destructive, eco-friendly, easy-to-use, and long-term strategy for cultural preservation, one with excellent protection effects.