Biomimetic porous materials have contributed to the enhancement of solar-driven evaporation rate in interfacial desalination and clean water production. However, due to the presence of numerous microbes in water environment, biofouling should occur inside porous materials to clog the channels for water transfer, resulting in obvious inhibition of the solar-driven evaporation efficacy in long-term use. To prevent and control biofouling in porous materials for solar-driven evaporation, a facile and environment-friendly design is required in real application. Oak wood possesses vertically aligned channels for transpiration and polyphenol compounds with antimicrobial activity. In this work, inspired by the oak wood, we developed an anti-biofouling shape-memory chitosan scaffold with unidirectional channels and tannic acid coating (oak-inspired scaffold). The shape-memory property facilitated rapid decoration with oak-inspired photothermal and anti-biofouling coating inside the scaffold, respectively, which also promotes the material durability by avoiding the external force-induced permanent structure failure. More importantly, the oak-inspired tannic acid coating not only prevented bacterial adhesion and colonization, but also inhibited fungal interference. They were subjected to a microbe-rich environment, and after 3 days, the evaporation rates of the untreated chitosan scaffolds were obviously decreased to 1.24, 1.16 and 1.19 kg m-2 h-1 for C. albicans, S. aureus and E. coli, respectively, which were only 65.6, 61.4 and 63.0% of original performance (1.89 kg m-2 h-1). In comparison, the oak-inspired scaffold exhibited a high solar-driven water evaporation rate after incubation in microbial suspensions (1.80, 1.70 and 1.75 kg m-2 h-1 for C. albicans, S. aureus and E. coli after 3 days) and lake water (1.74 kg m-2 h-1 after one month). The bioinspired anti-biofouling scaffolds maintain as high as 86.7-91.8% of the solar-driven water evaporation ability after exposure to a microbe-rich environment, which is conducive to develop a biomimetic long-term durable structure in water treatment.