Two kinds of cellulose‐based gels were prepared by introducing chitosan, citric acid and epichlorohydrin, β‐cyclodextrin and butyl titanate on the basis of optimized cellulose matrix. Comparison of performance properties were swelling and photocatalysis. The results show that different amounts of butyl titanate, the amount of cross‐linking agent chlorochloropropane and the ratio of citric acid are closely related to the formation, properties, stability and photocatalytic properties of hydrogel. The optimum preparation conditions for obtaining a gel with good photocatalytic properties and maintaining excellent strength and swelling properties were: butyl titanate 0.4 mL, epichlorohydrin 1.5 mL, chitosan 0.5 g, β‐cyclodextrin 0.5 g and dried at 70 °C for 10 h.