Well-defined channels and inert and hydrolyzable structures of covalent organic frameworks make them excellent templates for the construction of polymeric scaffolds with a defined topology and properties. In this work, we report on the synthesis of thermoresponsive PNIPAM scaffolds templated by boronate ester COFs. Polymerization of N -isopropylacrylamide by azobisisobutyronitrile, encapsulated in COF channels, followed by the removal of the host framework resulted in PNIPAM scaffolds. The obtained scaffolds displayed different sizes and morphologies depending on whether polymerization was performed in the presence or absence of a crosslinking agent. In the presence of a crosslinking agent, porous PNIPAM scaffolds retained the size and the morphology of the COF, while without a crosslinking agent spindle-like microstructures were obtained. Constructed scaffolds were highly thermoresponsive and their morphology changed dramatically upon small temperature variations. This property was used for the controlled and selective removal of dye impurities from water. UV/visible absorption spectra showed that the obtained porous PNIPAM scaffold could effectively adsorb cationic and anionic dyes such as methylene blue (MB), rhodamine B (RhB), and fluorescein (FL) from wastewater. FL and RhB were effectively adsorbed by this scaffold, but a lower affinity was observed for MB. The absorption capacity of the PNIPAM1 sponge for FL, RhB and MB was 231 mg g −1 , 245 mg g −1 and 36 mg g −1 , respectively. Taking advantage of the high adsorption capacity and recyclability of the absorbant, it can be used for wastewater treatment.