A critical consideration in the application of phytoremediation to remediate sludge soil contaminated with heavy metals is the potential for leaching risks that prevail prior to the efficient uptake of these metals by plants. The most cost-effective method is to use heavy metal stabilizers with selective adsorption. A novel amide-based COF material (COF-TH) has been synthesized as a heavy metal stabilizer for Pb. COF-TH exhibits significant selectivity for Pb in five-metal-mixed solutions, with a distribution coefficient KD as high as 3279 mL·g–1, which was more than 7.3 times that of other heavy metals. The maximum adsorption capacity of COF-TH for Pb was 189 mg·g–1. The adsorption fitted Langmuir model and intra-particle diffusion model, and satisfied pseudo-second-order kinetic model. The excellent selectivity and adsorption performance originate from the complexation between abundant amide groups and Pb ions. Pot experiments and leaching assays confirm that COF-TH decreased Pb leachate concentrations by 77.8 % without significantly decreasing total phytoextracted amounts of other heavy metals, due to the high selectivity of COF-TH to Pb. Additionally, its positive impact on plant growth and microbial diversity makes it a promising soil remediation agent. This investigation offers a novel approach to mitigate the leaching risk of a specific heavy metal Pb during sludge land application by integrating soil phytoremediation with stabilization techniques.