The specific energy of electrochemical double-layer capacitors (EDLCs) can be increased by design of the pore architecture to provide large interfaces between electrodes and electrolyte and efficient access to these surfaces. Colloidal-crystal templated carbon electrodes with interconnected, uniform mesopores have demonstrated high capacitances at fast charge/discharge rates in EDLCs used with ionic liquid electrolytes. Here we aim to enhance capacitive performance further through nitrogen doping, by combining a phenol-formaldehyde precursor with the ionic liquid (IL) 1-ethyl-3-methylimidazolium dicyanoamide (EMI-DCA) as the nitrogen source. The IL content in this precursor affects the resistance, structural integrity, and specific capacitance of the porous electrodes. With an IL content up to 50 wt%, the electrode resistance is reduced while the bicontinuous mesoporous structure of the resulting carbon is preserved. The specific capacitance of an electrode prepared with 50% IL in the precursor increases over 40% at 10 A g−1 compared to mesoporous carbons prepared using only the phenol-formaldehyde resol. With an ionic liquid electrolyte, the maximum specific capacitance is 237 F g−1 at 0.1 A g−1, and a specific capacitance of at least 195 F g−1 is maintained after 1000 cycles at 1 A g−1. A higher IL content in the precursor results in reduced structural order and capacitive performance.