Porous g-C3N4 was synthesized by a facile template-free method to control the reaction of polymer according to Le Chatelier's principle. The resulting porous g-C3N4 material has high Brunauer–Emmett–Teller (BET) surface area (201–209 m2 g−1) and large pore volume (0.50–0.52 m3 g−1), and shows a ten times enhanced photocatalytic activity for methyl orange (MO) photodegradation under visible light (λ > 420 nm) irradiation.