Lithium–sulfur (Li–S) batteries have attracted much attention due to their ultrahigh theoretical specific capacity. However, serious capacity attenuation caused by shuttle effect still inhibits the performance improvement. Herein, a modified separator consists of the few-layer graphene as a highly conductive network and stable scaffold to support P-doped boron nitride (denoted as BN-P@GO) as the functional interlayer of Li–S batteries. The cell with the interlayer provides an initial discharge capacity as high as 1045.3 mAh g−1, and retains a high reversible capacity of 728.7 mAh g−1 at 1 C after 500 cycles with a capacity decay of 0.061% per cycle. Moreover, the rate capability is also superior to cells with BN@GO or BN-P interlayers, i.e. reversible capcity of 457.9 mAh g−1 even at 3 C. The excellent electrochemical performance is ascribed to the synergistic effect of physical barrier and chemical adsorption for dissolved polysulfides provided by the modified layer. Furhtermore, it also mitigates the polarization and promotes kinetic reactions of the cells. This work provides a concise and effective method for commercialization of lithium–sulfur batteries.