In this study, poly(vinyl alcohol) (PVA) and poly(ethylene oxide) (PEO) hydrogels were synthesized and evaluated as adsorbent for dye removal from wastewater using methylene blue (MB) in aqueous solution as probe. PEO samples were photochemically prepared by varying irradiation time (1–16 h), while PVA samples were synthetized with different concentration of glutaraldehyde (GA) (0.03–0.48%). The obtained hydrogels were obtained through the analysis of a swelling test, scanning electron microscopy, and adsorption studies. PEO hydrogels adsorption capacity was dependent on the irradiation time, while the PVA hydrogel adsorption capacity reduces with GA concentration. Both hydrogels demonstrated a Langmuir isotherm adsorption model at the equilibrium and pseudo‐second order kinetic fits properly. pH studies showed that when pH reaches 12, the adsorbed MB amount is close to 8 and 2 times higher than pH = 2 both hydrogels. Photochemical preparation of hydrogels shows an easier way of tuning their properties in order to maximize dye removal. © 2017 Wiley Periodicals, Inc. J. Appl. Polym. Sci. 2017, 134, 45043.