Increasing attention has been paid to the widespread contamination of azo dyes in water bodies globally. These chemicals can present high toxicity, possibly causing severe irritation of the respiratory tract and even carcinogenic effects. The present study focuses on the periodically reverse electrocoagulation (PREC) treatment of two typical azo dyes with different functional groups, involving methyl orange (MO) and alizarin yellow (AY), using Fe-Fe electrodes. Based upon the comparative analysis of three main parameters, including current intensity, pH, and electrolyte, the optimal color removal rates for MO and AY could be achieved at a rate of up to 98.7% and 98.6%, respectively, when the current intensity is set to 0.6 A, the pH is set at 6.0, and the electrolyte is selected as NaCl. An accurate predicted method of response surface methodology (RSM) was established to optimize the PREC process involving the three parameters above. The reaction time was the main influence for both azo dyes, while the condition of PREC treatment for AY simulated wastewater was time-saving and energy conserving. According to the further UV–Vis spectrophotometry analysis throughout the procedure of the PREC process, the removal efficiency for AY was better than that of MO, potentially because hydroxyl groups might donate electrons to iron flocs or electrolyze out hydroxyl free radicals. The present study revealed that the functional groups might pose a vital influence on the removal efficiencies of the PREC treatment for those two azo dyes.