Optimizing precursor quantities should be considered to enhance properties such as band gap, SBET, and capacitance. Particularly, the incorporation of diverse heteroatoms into nanoporous carbon frameworks has led to a novel class of materials with captivating properties. In the context of templated synthesis, this review scrutinizes both hard and soft techniques. Soft templating, being thermodynamically controlled, relies on interactions between supramolecular templates, and carbon precursors. The review intricately discusses recent advances and trends in hard, and soft templating for synthesizing highly order nanoporous carbons. These carbons are further functionalized with single, and multiple heteroatom doping and foreign elements.