HIGHLIGHTS • Co/Mo co-doped mesoporous graphitic carbon nitride (g-C 3 N 4) exhibited enhanced photocatalytic performances with regard to H 2 generation (8.6 times) and Rhodamine B degradation (10.1 times) compared with pristine g-C 3 N 4. • The density functional theory calculations and optical simulation illustrate that Co/Mo co-doping and the created mesoporous structure can enhance light absorption. • The enhanced activity depends on the synergistic effect of Co and Mo co-doping. ABSTRACT A novel photocatalyst of mesoporous graphitic carbon nitride (g-C 3 N 4) co-doped with Co and Mo (Co/Mo-MCN) has been one-pot synthesized via a simple template-free method; cobalt chloride and molybdenum disulfide were used as the Co and Mo sources, respectively. The characterization results evidently indicate that molybdenum disulfide functions as Mo sources to incorporate Mo atoms in the framework of g-C 3 N 4 and as a catalyst for promoting the decomposition of g-C 3 N 4 , resulting in the creation of mesopores. The obtained Co/Mo-MCN exhibited a significant enhancement of the photocatalytic activity in H 2 evolution (8.6 times) and Rhodamine B degradation (10.1 times) under visible light irradiation compared to pristine g-C 3 N 4. Furthermore, density functional theory calculations were applied to further understand the photocatalytic enhancement mechanism of the optical absorption properties at the atomic level after Co-or Mo-doping. Finite-difference time-domain simulations were performed to evaluate the effect of the mesopore structures on the light absorption capability. The results revealed that both the bimetal doping and the mesoporous architectures resulted in an enhanced optical absorption; this phenomenon was considered to have played a critical role in the improvement in the photocatalytic performance of Co/Mo-MCN.