Azide containing bipyridine complex of cobalt was grafted to the propargylated nanoporous graphitic carbon nitride (npg-C3N4) via click reaction to obtain heterogenized photocatalyst which could efficiently provide direct esterification of aldehydes under visible light irradiation at room temperature. The use of click reaction as grafting strategy provided covalent attachment of the cobalt complex to support which not only provided higher loading but also precluded the leaching. Furthermore, the presence of carbon nitride support exhibited synergistic effect to enhance the reaction rate. In addition, the milder basic nature of nitrogen containing graphitic support provided efficient ester synthesis without the need for an external base. The synthesized photocatalyst was found to be quite robust which could easily be recovered and reused several times without significantly losing activity.