© 2016 WILEY-VCH Verlag GmbH & Co. KGaA, Weinheim.One-dimensional (1D) porous materials have shown great potential for gas storage and separation, sensing, energy storage, and conversion. However, the controlled approach for preparation of 1D porous materials, especially porous organic materials, still remains a great challenge due to the poor dispersibility and solution processability of the porous materials. Here, carbon nanotube (CNT) templated 1D conjugated microporous polymers (CMPs) are prepared using a layer-by-layer method. As-prepared CMPs possess high specific surface areas of up to 623 m2 g-1 and exhibit strong electronic interactions between p-type CMPs and n-type CNTs. The CMPs are used as precursors to produce heteroatom-doped 1D porous carbons through direct pyrolysis. As-produced ternary heteroatom-doped (B/N/S) 1D porous carbons possess high specific surface areas of up to 750 m2 g-1, hierarchical porous structures, and excellent electrochemical-catalytic performance for oxygen reduction reaction. Both of the diffusion-limited current density (4.4 mA cm-2) and electron transfer number (n = 3.8) for three-layered 1D porous carbons are superior to those for random 1D porous carbon. These results demonstrate that layered and core-shell type 1D CMPs and related heteroatom-doped 1D porous carbons can be rationally designed and controlled prepared for high performance energy-related applications.