Magnetic CoFe O -embedded porous graphitic carbon nanocomposites were prepared through a facile solid-phase thermal reaction with NaCl as a template. The material was applied in the magnetic solid-phase extraction process coupled with high performance liquid chromatography with a diode array detector to detect the trace fenpropathrin, cyhalothrin, S-fenvalerate, and bifenthrin in different water samples. The synthesis conditions of nanomaterial including glucose concentration and calcination time on extraction performance for pyrethroid pesticides have been investigated. Different magnetic solid-phase extraction parameters have been studied, such as the nanomaterial amount, solution pH, eluent types, adsorption time, and the reusability. Under the optimum conditions, good recoveries (80.2-110.9%) were achieved with relative standard deviations of 0.2-5.8%. There are probably hydrophobic interactions and dipole-dipole attractions between nanocomposites and the analytes.