Despite widespread focus on porous carbons for lithium-sulfur battery cathode materials, electrode design to preserve mass-specific performance and sustained extended cycling stability remains a challenge. Here, we demonstrate electrochemically etched porous silicon as a sacrificial template to produce a new class of functional mesoporous carbons optimized for dual chemical and physical confinement of soluble polysulfides in lithium-sulfur battery cathodes. Melt infiltration loading of sulfur at 60 wt% enables initial discharge capacity of 1350 mAh/gsulfur at rates of 0.1 C - approaching theoretical capacity of 1675 mAh/gsulfur. Cycling performance measured at 0.2 C indicates 81% capacity retention measured over 100 cycles with 830 mAh/gsulfur capacity. Unlike other carbons, this template combines structural properties necessary for sulfur containment and polysulfide confinement to achieve high specific capacity, but also boasts surface-bound oxygen-containing functional groups that are able to chemically anchor the soluble Li2Sn species on the interior of the mesoporous carbon to sustain cycling performance. In turn, this elucidates a scalable and competitive material framework that is capable, without the addition of additional membranes or inactive anchoring materials, of providing the simultaneous anchoring and confinement effects necessary to overcome performance limitations in lithium sulfur batteries.