Vivianite recovery from wastewater driven by Geobacter is one of the promising approaches to address the challenges of phosphorus (P) resource shortage and eutrophication. However, the interfere of heavy metals which are prevalent in many actual wastewater with this process is rarely reported. In this study, we investigated the impact of heavy metals (i.e., Cu and Zn ions) on microbial activity, Fe reduction, P recovery efficiency, and their fate during Geobacter-induced vivianite recovery process. The experimental results showed that low and medium concentrations of Cu and Zn prolonged the Fe reduction and P recovery time but had little effect on the final P recovery efficiency. However, high concentrations of Cu and Zn ultimately inhibit vivianite formation. In addition, the different concentrations of Cu and Zn showed different effects on the morphology of the recovered vivianite. The migration of Cu and Zn was analysed by stepwise extraction of heavy metals in the vivianite. Medium concentrations of Cu and Zn were more likely to co-precipitate with vivianite, while adsorption was the primary mechanism at low concentrations. Furthermore, there were differences in the fate of Cu and Zn, and a competition mechanism was observed. Finally, we found that increasing the Fe/P ratio can significantly reduce the residues of heavy metals in vivianite. It also increased the adsorbed Cu and Zn proportion and reduced co-precipitation. These results provide insights into improving the efficiency of vivianite recovery and managing the environmental risks of heavy metal in the recovered product.