The catalytic hydrogenation of carbon dioxide to formate is of great interest due to its significant role in CO2 utilization. In this study, a novel heterogeneous Ru(III) catalyst was prepared by immobilizing RuCl3 on a porous organic polymer (POP) obtained from 1,4-phthalaldehyde (PTA) and 4,4'-biphenyldicarboxaldehyde (BPDA) with melamine. A copolymerization strategy utilizing monomers of varying lengths was employed to prepare the POP-supported Ru catalyst with adjustable porosity. The optimization of the framework porosity resulted in enhanced CO2 affinity, accelerated mass transfer, and a remarkable enhancement in catalytic activity. A high turnover number (TON) of 2458 was achieved for the CO2 hydrogenation to formate in 2 h with catalyst Cat-3 under 3 MPa (CO2/H2 = 1 : 1) at 120 °C in 1 M Et3N aqueous solution. Moreover, the Cat-3 demonstrated good recyclability and was able to be reused for five consecutive runs, resulting in a high total TON of 9971.