Water pollution poses a grave threat to public health and the environment. There is an urgent need for sustainable remediation strategies to remove toxic contaminants from water sources. In this study, we report the development of a novel pH-responsive nanocomposite hydrogel for the effective degradation of organic pollutants. The hydrogel was synthesized using polyvinyl alcohol, graphene oxide, glutamic acid, and titanium dioxide through an in-situ crosslinking method. Characterization using SEM, FTIR and UV–vis spectroscopy confirmed the successful formation of the nanocomposite structure. Batch experiments demonstrated that the hydrogel was able to degrade over 90% of methylene blue dye within 35 min under sunlight irradiation, owing to the synergistic effect of pH-sensitivity and the photocatalytic activity of titanium dioxide. Degradation efficiency increased with rising pH, reaching a maximum at pH 11. This eco-friendly nanohybrid holds tremendous potential for water remediation applications through low-cost, solar-powered degradation of toxic pollutants.