The optimisation of the electrocoagulation‐electroflotation (EC‐EF) process assisted by the mucilage of the Opuntia ficus indica (OFI), on the turbidity removal was performed through the response surface methodology (RSM). For a solution of 300 mg/L of silica gel, high turbidity removal (93.14% ± 1.31) was obtained under the optimal conditions of 2.5 mg/L, 21.2 V, 9.65 and 2.61 mS/cm for the mucilage concentration, voltage, pH and conductivity, respectively, this experimental value was close to the predicted value of 92.96% ± 0.3. OFI mucilage increases turbidity removal efficiency and reduces specific energy consumption at a fixed current density. The turbidity removal of the EC‐EF process was improved by 30.94% compared with the conventional EC–EF (EC–EF without OFI mucilage) which shows 62.02% ± 1.45 of turbidity removal.