A diimide based porous organic polymer (POP) post-synthetically reduced with lithium metal demonstrates a drastic increase in selectivity for carbon dioxide over methane.