Oxidized porous g-C3N4 is obtained by a facile thermal oxidation approach. The obtained thermally oxidized porous g-C3N4 shows much higher photocatalytic hydrogen evolution activity than that of the pristine sample under visible light. It is found that the introduction of functional oxygen-containing group in the intralayer framework of g-C3N4 plays a key role in the enhanced photocatalysis. This thermal oxidation approach is desirable for mass production.