In the present study, we describe an effective method for the synthesis of Graphitic carbon nitride (GCN) nanostructures using porous anodic alumina (AAO) membrane as template by simple thermal condensation of cyanamide. Synthesized nanostructure was fully analysed by various techniques to detect its crystalline nature, morphology, luminescent properties followed by the evaluation of its photocatalytic activity in the degradation of Methylene blue dye. Structural analysis of synthesized GCNNF was systematically carried out using x-ray powder diffraction (XRD) and scanning electron microscope (SEM), and. The results confirmed the growth of GCN inside the nanochannels of anodic alumina templates. Luminescent properties of GCNNF were studied using photoluminescence (PL) spectroscopy. PL analysis showed the presence of a strong emission peak in the wavelength range of 350–600 nm in blue region. GCNNF displays higher photocatalytic performance in the photodegradation of methylene blue compare to the bulk GCN.Highlights1. In the present paper, we report the synthesis of graphitic carbon nitride nanofibers (GCNNF) using porous anodic aluminium oxide membranes as templates through thermal condensation of cyanamide at 500 °C.2. The synthesis of Graphitic carbon nitride nanofibers using porous andic alumina template is the efficient approach for increasing crystallinity and surface area.3. The high surface area of graphitic carbon nitride nanofibers has a good impact on novel optical and photocatalytic properties of the bulkGCN.4. AAO templating of GCN is one of the versatile method to produce tailorable GCN nanostructures with higher surface area and less number of structural defects.5. Towards photocatalytic degradation of dyes, the tuning of physical properties is very essential thing hence we are succeeded in achieving better catalytic performance of GCN nanostructures by making use of AAO templates.