In this research, the treatability of slaughterhouse wastewater was investigated by using the electrochemical method with Mg electrodes. The influence of the variables such as initial pH (4, 5, 6, 7, 8, and 9), current density (15, 30, and 45 mA/cm2), and reaction time (20, 25, and 30 min) on the removal efficiency of ammonium and phosphate was studied. The highest phosphate removal efficiency was reached at 100% after 20 min of electrochemical treatment with 30 mA/cm2 of current density and initial pH 6. Meanwhile, the maximum removal percent of ammonium was approximately 52%. Thus, this method is feasible to apply for the removal of phosphate and ammonium in slaughterhouse wastewater.