The large surface area providing more reactive sites and the fitting energyband structure accelerating electron migration over photocatalysts are indispensable in controlling the photocatalytic activity via the morphology modulation and optimized electronic structures. For enhancing the photocatalytic performance, herein, nitrogen vacancies with ultrathin porous polymeric carbon nitride (g-C 3 N 4 ) were synthesized by conventional polymerization combined with melamine and sublimation sulfur under the N 2 atmosphere. During this process, the escape of gas (NH 3 and CO 2 ) generates the porous structure, while the presence of sublimated sulfur carries away the N atoms of the framework to create unsaturated carbon sites, resulting in N vacancies. The ultrathin mesoporous system would increase the specific surface area of g-C 3 N 4 and reduce the transfer distance of the photoinduced carriers. Additionally, the optimal nitrogen defects might slightly enhance the visible light response activity and decrease the recombination of photoinduced electron−holes. These results led to a superior photocatalytic hydrogen evolution rate at 3.16 mmol/g/h, which was increased by 57.45-fold compared with pristine g-C 3 N 4 (0.055 mmol/g/h). The present research provides helpful insight into designing an effective and low-cost method for fabricating promising photocatalysts using sublimation sulfur as a defective forming agent to obtain a novel photocatalyst with both ultrathin vacancies and porous structure.