A novel porous hydrogel adsorption material, called PAM/PAA/PDMTM gel, has been developed for the removal of heavy metal ions in complex systems. The gel is composed of polyacrylamide, polyacrylic acid, and poly(2,4-dimercapto-6-mercaptopropenyl-1,3,5-triazine) monomer. This hydrogel material features a large pore structure, abundant active functional groups, high swelling properties, good thermal stability, and remarkable regeneration ability. More importantly, the hydrogels contain a variety of active groups, they show good complex adsorption properties for heavy metals. The PAM/PAA/PDMTM gel demonstrated excellent adsorption performance, with the maximum adsorption capacity of Cu2+, Cd2+ and Pb2+ reaching 92.33, 110.08 and 200.97 mg g−1 (pH 5, 298 K), respectively. And the adsorption was in accord with the pseudo-second-order model and Langmuir model. Notably, the PAM/PAA/PDMTM gel also demonstrated remarkable adsorption capacity for Pb even in soil, making it an efficient adsorption material for removing heavy metals from both water and soil samples.