In this study, chitosan was modified with cellulose and gelatin for the removal of Cu2+, Fe2+, and Pb2+ from oily wastewater. Chitosan was characterized using Fourier‐transform infrared spectroscopy (FTIR), scanning electron microscopy (SEM), and X‐ray diffraction (XRD). Carbon (77.54%), hydrogen (10.30%), oxygen (8.89%), nitrogen (2.74%), and sulphur (0.53%) were found in the organic constitution of the oil utilized, according to elemental analysis. Despite the presence of other metal ions in the used oil and effluent, this study focused solely on Cu2+, Fe2+, and Pb2+. Studies on the removal of Cu2+, Fe2+, and Pb2+ from oily wastewater were conducted, and multiple effect factors such as temperature and pH, time and pH, solvent and pH, temperature and time, temperature and solvent, and time and solvent were evaluated. An adsorption study was performed to remove the heavy metals. The results revealed that the highest percentage removal of Cu2+ was 96.62 (pH = 7.52 and conductivity = −12 mV), of Fe2+ was 97.95 (pH = 6.30 and conductivity = +68 mV), and of Pb2+ was 98.86 (pH = 10.58 and conductivity = −170 mV). To analyze the impacts of experimental factors, experiments were developed using central composite design (CCD) based on response surface methodology (RSM).