In this paper, melamine and pyridine dicarboxylic acid were used to synthesis organic macromolecule precursors by hydrothermal synthesis, and graphitic carbon nitride (x% py-CN) modified with pyridine was designed. The x% py-CN catalysts were characterized by TEM, XRD, XPS, FT-IR and EIS. The photocatalytic reduction performance of x% py-CN catalyst was investigated by using Cr(VI) as the target pollutant. The results showed that 10% Py-CN had the best photocatalytic performance under simulated sunlight, and the photocatalytic reduction rate of 15mg/L Cr(VI) reached 85% under 3h irradiation. The improvement of the photocatalytic activity of catalysts was attributed to the fact that the modification of pyridine could effectively improve the separation efficiency of photogenerated electron hole pairs. In addition, the repeated cycle experiment showed that the catalyst has good stability and recycling ability, and had a good application prospect. © 2022 Chinese Society for Environmental Sciences. All rights reserved.