© 2021, The Author(s), under exclusive licence to Springer Nature Switzerland AG part of Springer Nature.High volumes of wastewater with high pollutant concentration form in the transesterification stage of the process applied for biodiesel production from waste vegetable oils. In this study, application of the advanced electrocoagulation process following acidification was investigated in the biodiesel wastewater treatment. Through the acidification step of the sequential process, respectively, 25.4%, 68.7%, and 50.0% removal efficiencies for COD, oil-grease, and volatile fatty acids (VFAs) were obtained. Electro-activated persulfate (EAP) oxidation was modeled and optimized by using the response surface methodology and Box–Behnken design. The effect of independent variables (current, persulfate/COD ratio, time) on COD, oil-grease, VFAs removal, and total cost and the interaction of the variables of the process were determined. The maximum oil-grease removal efficiency predicted by using the model was 98.3% under the optimum conditions (current: 4 A, persulfate/COD: 4.4, and time: 15 min), whereas oil-grease removal efficiency obtained by the verification experiments performed at optimum conditions was found to be 97.2%. Sequential acidification–EAP process is an appropriate treatment method for biodiesel wastewater with high oil-grease concentration, and response surface methodology is a powerful tool for optimizing the operational conditions of EAP oxidation for COD, oil-grease, VFAs removal, and total cost. Graphical abstract: [Figure not available: see fulltext.].