The hierarchically porous graphitic carbon monoliths containing nickel nanoparticles (HPGCM-Ni) were fabricated via multi-component co-assembly in polyurethane (PU) foam scaffold associated with a direct carbonization process from triblock copolymer F127, diblock copolymer PDMS-PEO, phenolic resol, and nickel nitrate and subsequent silicates removal with NaOH solution. The decomposable PU foam scaffold played important role in the process of multi-component co-assembly and macrostructure formation. The nickel salts were reduced to metallic Ni nanoparticles during the carbonization process. The obtained HPGCM-Ni materials exhibited macropores of 100-450 lm, mesopore size of 7.2 nm, BET surface area of 725 m 2 g 21 , pore volume of 0.74 cm 3 g 21 , and saturation magnetization of 2.3 emu g 21 . Using methyl orange as model dye pollutant in water, HPGCM-Ni samples showed good adsorption capacity of 440 mg g 21 , exhibiting excellent adsorption characteristics desirable for the application in adsorption of dyes and separation under an external magnetic field.