Sulfonated porous aromatic frameworks (SPAFs) accelerate Li-ion diffusion while retarding the polysulfide shuttle effect in Li–S batteries. This leads to high residual capacity above 1000 mA h g−1 and coulombic efficiency (>99.5%) after 500 cycles.