A series of furan/thiophene-derived Cr-MIL-101s were obtained via visible-light-mediated C-C bond-forming catalysis within photosensitizing porous materials. The guest trapping process was achieved under very mild and metal-free conditions, affording newly functionalized MOFs with more π-π stacking, hydrogen bonding properties and excellent adsorption capacity in removing herbicides from aquatic environments.