The outstanding visible light response of carbon nitride has aroused intense expectations regarding its photocatalysis, but it is impeded by the inevitable defects. Here, we report on a facile melamine-based defect-remedying strategy and resultant carbon nitride high-performance photocatalysts (R-C 3 N 4 ). Melamine with amino groups and a triazine structure was selected as a "little patch" to passivate and remedy various defects inside carbon nitride. Such a remedying effect has been comprehensively proven by Fourier transform infrared spectroscopy (FT-IR), X-ray photoelectron spectroscopy (XPS), transmission electron microscopy (TEM), scanning electron microscopy (SEM), X-ray diffraction (XRD) analyses, and the ninhydrin test. In addition, their effects on photocatalysis were also individually confirmed by chemical methods, including cyano reduction reactions and deamination reactions. Furthermore, melamine remediation can result in g-C 3 N 4 /mpg-C 3 N 4 junctions, which also favors electron transfer and charge separation during the photocatalytic reaction. In order to explore its broader applications, R-C 3 N 4 was used as a photocatalyst for the photooxidation reaction of 1,4dihydro-2,6-dimethylpyridine-3,5-dicarboxylate (1,4-DHP) and simultaneous H 2 evolution. The conversion rates of 1,4-DHP and H 2 production catalyzed by R-C 3 N 4 were enhanced 2 and 6.5 times, respectively. This rational design is beneficial for the conversion of 1,4-DHP during the preparation of bioactive compounds and clean hydrogen production at the same time.