The direct functionalization of ordered mesoporous carbon nanopipes was achieved by using nitrogen-containing carbon precursor and SBA-15 as a removable template. The prepared carbon material has uniform pore structure as CMK-5 type and retained a relativ