A high loading of Mn(ii)-metalated porphyrin was achievable in a 2D porphyrin-based Mn-MOF induced by an ionic liquid. The excellent stability, sufficient redox potential, atomically dispersed porphyrin Mn(ii) sites, desired CO2 affinity, high visible light-harvesting and efficient charge separation, endow this MOF with the overall photocatalytic conversion of CO2 to CH4 in gas-solid conditions.