To lengthen the lifecycles of polyaniline (PANI) electrodes, a hierarchical porous PANI was synthesized from PANI/silica self‐aggregates through a facile one‐pot method. Hydrogen bonding between NH groups in aniline/PANI and OH groups in nanosilica template led to a type of self‐assembly, which enabled the formation of uniform nanoparticles. Silica self‐aggregates provided macroporous channels, resulting in a decreased diffusion distance. After removal of the hard template, the porous PANI had a large, porous surface area (55.89 m2 g−1), in comparison with nonporous PANI (12.45 m2 g−1). The porous PANI was analyzed using Fourier transform infrared and UV‐visible spectroscopies, scanning electron microscopy, thermogravimetric analysis, cyclic voltammetry, electrochemical impedance spectroscopy and galvanostatic charge–discharge measurements. Because of its hierarchical structure, the resultant porous PANI possessed a higher capacitance (397 F g−1) than nonporous PANI (280 F g−1) at 1 A g−1 in 1 mol L−1 H2SO4 electrolyte. © 2018 Society of Chemical Industry