In-situ synthesis of g-C3N4 containing nitrogen vacancies and cyano group via one-pot method using urea as the precursor. The structural, morphological or electrochemical properties of synthesized photocatalysts were characterized by XRD, BET analysis, TEM, FTIR, UV-DRS, PL, XPS and EPR. It was found that the nitrogen vacancy was successfully introduced into g-C3N4. Compared to pure g-C3N4, the (200) crystal plane in XRD of synthesized g-C3N4 showed slight red-shift, and the BET surface areas had changed from 27.5 to 35.7 m2·g−1, which could provide more reaction center and active site. TEM confirmed that g-C3N4 and VN-g-C3N4 were porous materials, and FTIR, XPS as well as EPR could prove the presence of nitrogen vacancies and cyano group. The UV-Vis absorption edge of VN-g-C3N4 demonstrated briefly red-shift, PL intensity and lifetime of carriers declined in comparison with pure g-C3N4. Electrochemical test results showed that enhanced charge separation efficiency and low recombination rate of charge carriers of VN-g-C3N4. The photocatalytic activity of the photocatalysts was researched by RhB degradation and ACT removal under visible light irradiation, the results showed the rate of RhB degradation on the VN-g-C3N4 was 81%, which was 1.4-fold as high as that of g-C3N4 in visible light. The degradation contribution from the active species were h+ (67.3%) >1O2(63.0%)>•OH (49.4%) >•O2− (20.3%) > e− (20.1%) > H2O2(0.2%), and VN-g-C3N4 exhibited excellent ACT removal rate, which was 1.6-fold higher than that of pure g-C3N4 in visible light. This study provides an efficient photocatalyst for the treatment of toxic wastewater.