Graphitic carbon nitride (GCN), as a promising photocatalyst, has been intensely investigated in the photocatalytic fields, but its performance is still unsatisfactory. To date, metal ion doping has been proven to be an effective modification method to improve the photocatalytic activity of GCN. More importantly, comprehensive understanding of the doping mechanism will be of benefit to synthesize efficient GCN based photocatalysts. In this work, K + -doped GCN samples were prepared via heating the mixture of the preheated melamine and a certain amount of KCl at different synthetic temperatures. XRD and Raman characterization studies indicated that the introduction of K + could improve its crystallinity at higher temperature but reduce its crystallinity at lower temperature. Moreover, FTIR and SEM-EDS measurements implied that K + are found dominantly in the surface of the ion-doped sample prepared at lower temperature, while they are found both in the surface and bulk of the ion-doped sample prepared at higher temperature. These observations revealed that K + distributed in the surface of the ion-doped GCN could inhibit its crystal growth, while K + distributed inside of the ion-doped GCN could promote its crystallinity. Owing to the greater inducing effect of the bulk K + than the disturbing effect of the surface K + , the improvement of the crystallinity for K + -doped GCN was achieved. As a result, the K + -doped GCN with higher crystallinity yielded an obviously higher H 2 evolution rate than that with lower crystallinity under visible light irradiation (>420 nm). Besides, it was observed that the K + -doped GCN prepared at higher temperature exhibits significantly greater adsorption capacity for methylene blue than the K + -doped GCN prepared at lower temperature. This work would provide an insight into optimizing metal ion doped GCN with high photocatalytic activity.