Photocatalytic conversion of H2O and O2 into H2O2 provides a promising sustainable ambient-condition route alternative to energy-intensive anthraquinone processes for on-site H2O2 production. Herein a series of K-doped cyano-rich g-C3N4 with porous structure (g-PC3N4K) have been successful synthesized by a molten salt assisted pyrolysis with subsequent secondary pyrolysis under the assis