We report a facile and sustainable route to prepare the porous g-C3N4 by using starch as green in situ gaseous template and melamine as a precursor. The as-prepared g-C3N4 exhibited a porous thin sheet like structure with a larger surface area and showed an efficient separation efficiency for radiative charge carriers. The textural structure and morphology of the porous g-C3N4 materials were well characterized by TEM, SEM, XRD, BET, FT-IR, Raman, XPS, UV–vis DRS and PL spectroscopy. The starch mediated porous g-C3N4 photocatalyst demonstrated significantly an enhanced visible light photocatalytic performance and excellent physicochemical stability for the photodegradation of organic pollutants (including rhodamine B and phenol). The results revealed that, the optimized gaseous template contents had a significant influence on photooxidative chemical reaction of the as-prepared samples. The radical scavenging experiments proved that holes and O2− are the main reactive species responsible for the visible light degradation of rhodamine B. This simple, economical and green strategy using starch as gaseous porogen agent for the fabrication of porous g-C3N4 with excellent visible-light photocatalytic activity is desirable for environmental remediation and solar energy applications.