Hydrogen, as a sustainable and clean energy, has been considered as a promising candidate to replace fossil fuels. And it is meaningful to fabricate the photocatalysts to drive photocatalytic water splitting leading to hydrogen production. Herein, a facile approach was developed by the means of the template effect of poly (ionic liquid) and self‐assembly of cyanuric acid and melamine through hydrogen bonds, to obtain carbon nitride hollow microspheres with highly hierarchical porosity. The influence of poly (ionic liquid) concentration on the structure and photocatalytic activity of as‐prepared carbon nitride was investigated. The optimized carbon nitride hollow microspheres possessed the multiple porous channels and improved surface area (71 m2/g) due to the decomposition of poly (ionic liquid) and cyanuric acid‐melamine supramolecular aggregates. Moreover, the as‐prepared carbon nitride hollow microspheres exhibited a remarkable catalytic activity in the photocatalytic hydrogen evolution reaction under visible light irradiation. Especially, the sample CN‐0.02 exhibits the highest hydrogen evolution rate (90.1 μmol h−1). The outstanding photocatalytic activity is attributed to the high specific surface area, broad light absorption range and fast separation rate of photogenerated electron–hole pairs. This novel method opens up a new way toward the development of highly‐active photocatalysts for water splitting.