The poor absorption of visible light and rapid recombination of photoexcited charge carriers are the two main factors responsible for the low photocatalytic activities of g-CN under sunlight. To mitigate these technical challenges, we utilize molten-salt synthesis based on alkali metal iodide. The high reactivity of LiI/KI does not allow the polycondensation of triazine dicyanamide intermediates further into PTI, the degree of which depends on the initial weight ratio of eutectic mixture to molecular precursor. This enables the controlled introduction of cyano functional groups with K+-coordination and decomposition of tri-s-triazine into triazine. The resulting allin-one g-CN-I displays a photocatalytic hydrogen evolution reaction rate of 147 and 60 mu mol/h from water under visible light and sunlight, respectively, which are 76 and 7 times higher than those of bulk g-CN. This study demonstrates the significant improvement in the photocatalytic activity of g-CN achievable through the synergistic combination of structural functionalities.