Porous polymers have received much interest due to their wide range of applications in catalysis, gas separation, structure replication, electrode materials, etc. It is particularly appealing to synthesize macro- and mesoporous polymers because hierarchical porous structures have the advantages of each class of hierarchical pores and offer transport and diffusion pathways, especially for larger guest species. Herein, we propose a CO2-in-ionic liquid (IL) emulsion templating route for the synthesis of porous polymers. The polymerization is initiated by UV irradiation to get a fast polymerization rate. Highly porous polyacrylamide and poly(trimethylolpropane trimethacrylate) with hierarchical macro- and mesoporousstructures were obtained, and the porosity properties can be easily tuned by the control of pressure. The as-synthesized polymers combine both advantages of mesopores and macropores andhave shown application potential in catalysis. The CO2-in-IL emulsion templating route can be applied to the synthesis of both hydrophilic and hydrophobic polymers owing to the well solvency of IL for a wide range ofcompounds.This work has been published in Angew. Chem. Int. Ed. (2013, 52, 1792-1795).