The invention belongs to the technical field of organic synthesis and heterogeneous catalysis, and particularly relates to a method for preparing a formamide compound by catalyzing carbon dioxide hydrogenation through a porous material. The method comprises the following steps: by taking a porous organic metal polymer as a catalyst, reacting an amine compound with carbon dioxide and hydrogen in anair atmosphere to prepare the formamide compound. The method has the advantages of high reaction efficiency, good selectivity, mild conditions, economy, environmental protection, simple operation andthe like; wherein a solid metal polymer material with large specific surface area, strong carbon dioxide adsorption, hierarchical pore channel distribution and highly dispersed metal centers is designed and synthesized as a reaction catalyst by changing a cross-linked copolymer proportion; the catalyst is especially used for catalytic synthesis of fine chemical N, N-dimethylformamide (DMF), doesnot need any additional solvent, alkali or other additives, and is convenient for separation and purification of DMF. The catalyst can be recycled; no special equipment is needed in the reaction, thereaction operation is simple, and further industrial application is facilitated.