A modified macroporous carbon (mMPC) containing CoNx site is developed for sulfur retention to enhance cycleability of lithium-sulfur battery. Various nitrogen sites such as graphitic-N, pyrrolic-N, pyridinic-N, pyridinic-N oxide, and CoNx are created during macropore formation. The sites without Co show limited polysulfide (PS) adsorption capability because nucleophilic N absorbs PS species via the weak interaction between N and Li in NLiS bondage. The electrophilic Co(II) in CoNx absorbs PS species via a strong interaction between S and Co in SCo bond. The dual interaction of CoNx site with SCo and NLiS bondages significantly enhances the PS adsorption. The resultant Li-S battery with the mMPC shows excellent cycleability, exhibiting a very low capacity degradation rate of 0.25 mAh g−1 per cycle after initial 20 cycles. A rate capacity as high as 660 mAh g−1 has been achieved after 300 cycles at 1 C charge-discharge rate.