Disposal of blue algae (BA) and corn gluten (CG) wastes and simultaneous recovery of the abundant phosphorus (P) and nitrogen (N) by pyrolysis to obtain biochars with high fertility is a promising strategy. However, pyrolysis of BA or CG alone by a conventional reactor cannot reach the target. Herein, we propose a novel MgO-enhanced N and P recovery method by designing a two-zone staged pyrolysis reactor to highly efficiently recover N and P with easily available plant forms in BA and CG. The results show that a 94.58% TP retention rate was achieved by means of the special two-zone staged pyrolysis method, in which the effective P (Mg2PO4(OH) and R-NH-P) accounted for 52.9% of TP, while the total nitrogen (TN) reached 4.1 wt%. In this process, stable P was formed first at 400 ℃ to avoid rapid volatilization and then to form hydroxyl P at 800 ℃.