Abstract Textile industry wastewater contains hazardous dyes and ionic contaminants that are difficult to remove using conventional treatment methods, highlighting the need for sustainable and efficient remediation materials. In this study, a novel sodium alginate/acrylic acid–iron nanoparticle-Moringa seed powder (SA/AA–Fe–MSP) nanocomposite hydrogel was synthesized for the dual removal of potassium ions and Azure B dye from aqueous solutions. The novelty lies in integrating bio-based Moringa oleifera seed powder with α-Fe₂O₃ nanoparticles within a crosslinked polymeric hydrogel matrix, providing synergistic adsorption and coagulation performance. The composite was prepared through free radical polymerization followed by Ca²⁺ crosslinking and characterized using FTIR, SEM-EDX, and XRD, confirming its functional groups, porous morphology, and crystalline iron oxide phases. Batch adsorption experiments demonstrated effective removal of both pollutants, which was further enhanced by alum-assisted coagulation-adsorption. RSM based on Central Composite Design was employed to optimize pH,dose, alum concentration, and contact time and to evaluate their interactive effects. Maximum removal efficiencies of approximately 85% for K⁺ and 98% for Azure B were achieved. Removal mechanisms involved electrostatic attraction, ion exchange, hydrogen bonding, and surface complexation. Overall, the SA/AA–Fe–MSP hydrogel offers a sustainable approach for effectively treating textile wastewater with complex contaminant characteristics.