An efficient photocatalytic CO 2 reduction has been reported in ZIF-67-derived-Co nanoparticles (NPs) encapsulated in nitrogen-doped carbon layers (N-C/Co). This work demonstrates that the pyrolysis temperature is crucial in tuning the grain size and components of metallic Co 0 of N-C/ Co composite catalysts, which optimizes their photocatalytic activities. Syntheses were conducted at 600, 700, and 800°C giving the N-C/Co-600, N-C/Co-700, and N-C/Co-800 samples, respectively. N-C layers can well wrap the Co NPs obtained at a low pyrolysis temperature (600°C) owing to their smaller grains than those of other samples. A high metallic Co 0 content in the N-C/Co-600 sample can be attributed to the effective inhibition of surface oxidation. By contrast, the surface CoO x oxides in the N-C/Co-700 and N-C/Co-800 samples cover inside Co cores, inhibiting charge separation and transfer. As a result, the N-C/Co-600 sample yields the best photocatalytic activity. The carbon monoxide and hydrogen generation rates are as high as 1.62 × 10 4 and 2.01 × 10 4 µmol g −1 h −1 , respectively. Additionally, the Co NPs make composite catalysts magnetic, enabling rapid and facile recovery of catalysts with the assistance of an external magnetic field. This work is expected to provide an instructive guideline for designing metal-organic framework-derived carbon/metal composite catalysts.