Anthraquinone-based hollow COFs were synthesized via a template-assisted method involving polystyrene nanospheres as the hard template, which enabled doubling the specific capacitance and energy density compared to non-templated COFs. Our approach can be extended to other COFs, offering a promising strategy for enhancing the performance of COF-based electrodes in energy storage applications.