The concentration of harmful metal ions is growing globally, which raises the risk to both human and ecological health. The use of “adsorption” technique has been found to be very effective, for the removal of toxic metal ions. Among other things, hydrogels as an adsorbent work effectively for the removal of toxic metal ions and other aquatic pollutants. The newly designed potato starch‐xanthate (SX) based hydrogel (SX‐modified hydrogel) has been synthesized using a mixture of acrylamide (AAm) and acrylic acid (AA) monomers, with the help of free‐radical graft copolymerization technique. The synthesized SX‐modified hydrogel has been characterized by several analytical techniques, namely, UV–visible (UV–vis) spectroscopy, Fourier transform infrared (FTIR) spectroscopy, gel permeation chromatography (GPC), thermogravimetric (TG) analysis, point of zero charge (ΔpHPZC) analysis, x‐ray diffraction (XRD) analysis, and scanning electron microscope (SEM) analysis. The main objective of the current work is to remove the Cu2+ and Co2+ ions from wastewater using SX‐modified hydrogel as well as to study the swelling and water retention properties of the SX‐modified hydrogel. The swelling ratio of SX‐modified hydrogel has been found to be 312.31, 374.01, and 410.20 g/g at optimum pH 10, temperature 35°C, time 675 min in gray wastewater, tap water, and distilled water, respectively. The maximum percentage removal of Cu2+ and Co2+ ions by SX‐modified hydrogel has been found as 97.7% and 94.2%, respectively, at optimum conditions. The Langmuir isotherm model fits best with the experimental data, with maximum adsorption capacity of 515.46 mg/g for Cu2+ and 483.09 mg/g for Co2+ ions, respectively. The kinetic studies suggest that the adsorption process is governed by the second order kinetic model with rate constant of 2.06 × 10−4 g/(mg min) for Cu2+ and 1.79 × 10−4 g/(mg min) for Co2+ ions, respectively. The negative ΔG values suggest the adsorption process is spontaneous in nature. In addition, the positive ΔH values support the adsorption process is endothermic in nature. The SX‐modified hydrogel showed a remarkable desorption efficiency with 96.7% for Cu2+ and 92.5% for Co2+ ions and reusability for four consecutive adsorption–desorption cycles. It can be concluded that the SX‐modified hydrogel has showed an effective, economical, easy, low energy consuming, and significant potential in the treatment of wastewater containing heavy metal ions.