The recovery of vivianite through the anaerobic digestion of waste-activated sludge has attracted considerable attention due to its operational simplicity and the high economic value of vivianite. This study concentrated on the recovery of vivianite from anaerobic fermentation systems through a strategy combining sludge pre-fermentation with the waste agricultural and forestry biomass-derived biochar (ZBC). In-depth analyses of the structure and functionality of ZBC were conducted using techniques such as Fourier-transform infrared spectroscopy (FTIR), X-ray photoelectron spectroscopy (XPS), and Raman spectroscopy. The sediment produced after the experiment and the changes in microbial community composition were characterized. The results indicated that pre-fermentation promoted phosphorus release, enhancing the synthesis of vivianite while selectively enriching respiratory and fermentative Fe (III)-reducing microorganisms. When FeOOH was used as the Fe (III) source, ZBC, through its dual action of redox functional groups and graphitization structure, increased the Fe2+ production by 243.6 % in the system dominated by respiratory Fe (III)-reducing bacteria. The optimal dosage of ZBC for the simultaneous recovery of vivianite resources and methane energy was 2.5 g/L. The combined application of pre-fermentation and ZBC provides a novel approach for the efficient recycling of vivianite and offers new insights into the reuse of agroforestry waste biomass resources.