a b s t r a c tIn this investigation, a facile modification of g-C 3 N 4 through co-pyrolysis of melamine and sodium nitrate or potassium nitrate was reported and the as-synthesized samples were characterized by a collection of techniques, such as X-ray diffraction, scanning electron microscopy, transmission electron microscopy, UV-vis diffuse reflectance spectroscopy, nitrogen adsorption-desorption, X-ray photoelectron spectroscopy, Fourier transform infrared spectroscopy, and elemental analysis. Based upon the analysis, we speculated that the g-C 3 N 4 framework was partially destroyed to produce cyano-containing fragments, which resulted into the variation of physical and optical properties, further affecting the adsorption and photocatalytic performance of g-C 3 N 4 on the dye methylene blue. Furthermore, we found that nitrate anions rather than sodium or potassium ions had important effect on the structure and photocatalytic performance of g-C 3 N 4 . In addition, the photocatalysis mechanism and reusability test were also investigated and discussed in the study.