CoS 2 and FeS 2 nanoparticles with mesoporous structures embedded in carbon polyhedrons are prepared by reasonable design of materials (CoS 2 -FeS 2 -NC), which are used as a modified cathode material. This composite material can limit the shuttling of polysulfides and catalyze and adsorb polysulfides. Further, electrochemical properties of Li−S batteries are enhanced. Li−S batteries using S/CoS 2 -FeS 2 -NC electrodes have the best cycle and rate performance. The S/CoS 2 -FeS 2 -NC cathode's initial discharge capacity at 0.2C is 938.9 mAh g −1 , while its reversible capacity remains 394.8 mAh g −1 after 200 cycles, with a 0.28% decline on average. S/CoS 2 -NC and bare sulfur cathodes have maximal discharging capacities of 82.3 and 63.8% of S/CoS 2 -FeS 2 -NC cathodes at 0.2C. The initial discharge capacity of S/CoS 2 -FeS 2 -NC at 0.5C is 795.6 mAh g −1 , and the capacity of 354.4 mAh g −1 is maintained after 200 cycles. So, S/CoS 2 -FeS 2 -NC has excellent electrochemical properties.