In this work, graphitic carbon nitride (g-C3N4) was synthesized with melamine and cyanuric acid. The g-C3N4 was modified with various soft templating such as sodium dodecyl sulfate (SDS), cetyl trimethyl ammonium bromide (CTAB), Pluronic P-123 and Triton-X-114. The heating temperature program was applied for synthesized samples to improve photocatalytic properties. The photodegradation process was performed under visible-light (9 W LED) for degradation of rhodamine B as a pollutant. The photocatalytic efficiency of g-C3N4 _SDS (96%) was significantly improved in related to the bulk sample g-C3N4 (43%). The photodegradation process was optimized by implement of BOX-Behnken design.