Ion-conducting polymer membranes are essential in manyseparation processes and electrochemical devices, including electrodialysis1, redox flow batteries2, fuel cells3 and electrolysers4,5. Controlling ion transport and selectivity in these membranes largely hinges on the manipulation of pore size. Although membrane pore structures can be designed in the dry state6, they are redefined upon hydration owing to swelling in electrolyte solutions. Strategies to control pore hydration and a deeper understanding of pore structure evolution are vital for accurate pore size tuning. Here we report polymer membranes containing pendant groups of varying hydrophobicity, strategically positioned near charged groups to regulate theirhydration capacity and pore swelling. Modulation of thehydrated micropore size (less thantwo nanometres) enables direct control over water and ion transport across broad length scales, as quantified by spectroscopic and computational methods. Ion selectivity improves in hydration-restrained pores created by more hydrophobic pendant groups. These highly interconnected ion transport channels, with tuned pore gate sizes, show higher ionic conductivity and orders-of-magnitude lower permeation rates of redox-active species compared with conventional membranes, enabling stable cycling of energy-dense aqueous organic redox flow batteries. This pore size tailoringapproach provides a promising avenue to membranes with precisely controlled ionic and molecular transportfunctions.