This study presents an innovative approach for synthesizing hierarchical porous carbon materials (HPCMs) tailored for high-performance supercapacitors. The proposed method combines oxidative foaming with self-activation, in-situ template, in-situ activation and template synthesis, respectively, utilizing glucose reactions with oxidizing agents like ammonium persulfate (APS), magnesium nitrate hexahydrate (MNH), and potassium persulfate (KPS). The process involves two stages: low-temperature foaming to initiate macropore formation and high-temperature annealing to create meso/micropores through in-situ template and activation. Generally, increasing the ratio of oxidant to glucose in the synthesis process can notably enhance the high specific surface area and pore volume of the HPCMs with a combination of micro/meso/macropores, exhibiting maximum values of 821 m2/g and 0.61 cm3/g (APS), 2077 m2/g and 3.05 cm3/g (MNH), 1845 m2/g and 1.29 cm3/g (KPS), respectively. Furthermore, the O and N, or S elements, can also be in-situ doped in the carbon framework. The hierarchical porous structure and the doping elements enhance the electrochemical performance of supercapacitors. The APS@4, with a high mass loading of 3.2 mg/cm2, exhibits a superior specific capacitance of 144 F/g and an areal capacitance of 456 mF/cm2 at a current density of 1 A/g. It demonstrates excellent cycling stability based on a capacitance retention of 100 % after 10,000 cycles.