Small-molecule ionic liquids (ILs) are frequently employed as efficient bulk phase modifiers for perovskite materials. However, their inherent characteristics, such as high volatility and ion migration properties, pose challenges in addressing the stability issues associated with perovskite solar cells (PSCs). In this study, we design a poly(IL) with multiple active sites, named poly[4-styrenesulfonyl(trifluoromethylsulfonyl)imide]pyridine (P[STFSI][PPyri]), as an efficient additive of perovskite materials. The S=O in the sulfonyl group chelates with uncoordinated Pb 2+ and forms hydrogen bonds with the organic cations in the perovskite, suppressing the volatilization of the organic cations. The N + in pyridine can fix halide ions through electrostatic interaction with I − and Br − ions to prevent halide ion migration. P[STFSI][PPyri] demonstrates the ability to passivate defects and suppress nonradiative recombination in PSCs. Additionally, it facilitates the fixation of organic and halide ions, thereby enhancing the device's stability and photoelectric performance. Consequently, the introduction of P[STFSI][PPyri] as a dopant in the devices resulted in an excellent efficiency of 24.62%, demonstrating outstanding long-term operational stability, with the encapsulated device maintaining 87.6% of its initial efficiency even after 1500 h of continuous maximum power point tracking. This strategy highlights the promising potential of poly(IL) as an effective additive for PSCs, providing a combination of high performance and stability.