Deprotonated mesoporous graphitic carbon nitride (mpg-C3N4) was achieved by a simple method of treatment of as-prepared materials with different basic aqueous solutions (K2CO3, KOH, tBuOK). The resultant polymeric materials show significantly enhanced basicity, while maintaining the original mesoporous structure. It was then used as a heterogeneous base catalyst for Knoevenagel condensations and transesterification reactions. Catalytic results show that the deprotonated mpg-C3N4 exhibits high efficiency for promoting these reactions as a solid and polymeric catalyst. The reactions between various aldehydes and malonic derivatives, alcohols and β-ketoesters could proceed smoothly in the presence of deprotonated mpg-C3N4. The catalyst could be recycled and reused for several runs without any loss of intrinsic catalytic activity.