The development of high‐temperature and salt‐resistant filtrate reducer is of great significance to the exploitation of deep and ultra‐deep wells. In this study, Zwitterionic copolymer PANDS was synthesized by free radical polymerization using acrylamide (AM), N‐vinylpyrrolidone (NVP), methacryloxyethyl trimethyl ammonium chloride (DMC) and sodium p‐styrene sulfonate (SSS) as monomers. Through orthogonal test, the optimum synthesis conditions were determined as follows: n (AM): n (NVP): n (SSS): n (DMC) = 3.5:2:0.5:0.5, the reaction temperature is 50°C, the initiator concentration is 0.4 wt%. The structure and thermal stability of the copolymers were analyzed by Fourier transform infrared spectroscopy (FT‐IR), nuclear magnetic resonance spectroscopy (1H‐NMR) and thermogravimetry (TG). In addition, the filtration reduction performance of PANDS was evaluated according to the American Petroleum Institute (API) standard. The mechanism of reducing filtration loss was studied by laser particle size analysis, Zeta potential and scanning electron microscope analysis of mud cake. The results show that PANDS has good temperature resistance and good filtrate loss reduction. With the addition of 1.5%PANDS, the filtrate loss of drilling fluid is 8.7 mL after aging at 160°C for 16 h, and can resist 6 wt% NaCl and 1 wt% CaCl2.