Graphitic carbon nitride (g-C 3 N 4 ) is known to photogenerate hydrogen peroxide in the presence of hole quenchers in aqueous environments.Here, the g-C 3 N 4 photocatalyst is embedded into a host polymer of intrinsic microporosity (PIM-1) to provide recoverable heterogenized photocatalysts without loss of activity. Different types of g-C 3 N 4 (including