Two in-vacuum undulators IVU25s and one elliptically polarized undulator EPU100 have been developed for the Shanghai Synchrotron Radiation Facility (SSRF). Two IVU25s with the same hybrid design contain about 636 Sm2Co17sub> magnet blocks with the dimension of 65 mm×25 mm×8.965 mm. The EPU100 of the APPLE-Ⅱ type contains about 668 NdFeB magnet blocks with the dimension of 35 mm×35 mm×25 mm. This paper presents the development of these magnet blocks, points out the basic factors which affect remanence distribution, magnetization deviation angle and mechanical dimension precision, and analyzes the basic principles. The magnetic properties, magnetic field quality and mechanical dimension precision of the developed magnet blocks satisfy the specifications of SSRF initial u