The recovery of nitrogen and phosphorus from wastewater can alleviate eutrophication of water bodies and the shortage of phosphate rock resources. A highly efficient adsorbent was prepared by loading magnesium onto red mud, which could recover ammonia nitrogen and phosphate from high-concentration polluted wastewater simultaneously. The response surface method based on Box-Behnken design was applied to explore the influence and the interaction of various parameters on the recovery effect. Further, the DFA(Desirability Function Approach) was used for multi-objective optimization, so that both ammonia and phosphate could achieve relatively high removal rates. SEM-EDS, BET, FTIR and XRD were used to characterize the raw materials and the products obtained under the optimal conditions. It was found that there were interactive effects among the parameters on the simultaneous recovery process. Optimal process parameters obtained were: the dosage 0.43 g, the mass ratio of NH4+:PO4-3 0.82, and the pH 3.5. Under the optimal conditions, the maximum adsorption capacities of ammonia and phosphate were 56.56 mg·g-1 and 105.53 mg·g-1, respectively. The adsorption mechanism mainly included physical adsorption, ion exchange, coordination exchange and chemical precipitation. And, struvite crystals produced by chemical precipitation method were the dominant component of the synchronous harvesting mechanism.