Intelligentization of materials and structures is an important trend. Herein, the stimuli-responsive 4D aerogel is used as a smart substrate for rapid reduction in tetracycline (TC) pollution, in which this smart stimuli-responsive substrate is designated as P4D. Its fourth dimension originates from stimuli-responsive characteristics with time evolution. Meanwhile, the covalent organic frameworks (COFs) composite is constructed by BiPO4 and triazine-based sp2 carbon-conjugated g-C18N3-COF (COF-1), which is another key aspect of COF-1/BiPO4@P4D for rapid photocatalytic degradation regarding TC pollution. This emerging smart structure of COFs@P4D can fix programmable temporary state and recover permanent state under thermal or water stimulus without any complicated equipment. Its performance can be tailored by structure, composition, and function. Compared with traditional powder-form photocatalysts, this stimuli-responsive structure provides attractive advantages, such as high permeable framework, self-adaptivity, flexibly customized functional groups, and fast reduction in TC pollution. The predictable development of COFs@P4D could draw much attention for various promising applications in pollution treatment and sensors.