We report a facile and eco-friendly one-pot synthesis of well-adorned mesoporous g-C3N4 material through a bubble templating strategy and involving controlling the surface area from 17 to 195 m2 g−1 by simply adjusting the mass ratio of melamine/NH4Cl.