Conjugated polymers are commonly adopted to develop electro-and photoresponsive materials due to their superior electronic conductivity and phototothermal convertibility. However, they are usually homogeneously polymerized within the network, which makes their functionalities challenging to spatiotemporally modulate. In this work, we report a convenient and extensible method to develop polypyrrole patterns in a thermally responsive sodium alginate/poly(N-isopropylacrylamide) hydrogel. The polypyrrole pattern is developed by spatial photoreduction of Fe 3+ ions into Fe 2+ ions and subsequently initiating oxidation polymerization of pyrrole by the residual Fe 3+ ions. During this process, carboxylate groups coordinated with Fe 3+ ions are also sacrificed in a gradient manner along the thickness direction, and the resulting concentration gradients of the carboxylate group endow the hydrogel with thermal-responsive actuation. The polymerized polypyrrole also renders the hydrogels' prominent temperature-rising behaviors upon NIR light irradiation. By designing the PPy pattern, hydrogels can exhibit versatile actuating behaviors and execute mechanical works such as lifting objects. This method is convenient and can be extended to develop other conjugated polymers in hydrogel systems for versatile applications.