Covalent organic frameworks (COFs) have emerged as a kind of crystalline polymeric materials with high compositional and geometric tunability. Most COFs are currently designed and synthesized as mesoporous (2–50 nm) and microporous (1–2 nm) materials, while the development of ultramicroporous (<1 nm) COFs remains a daunting challenge. Here, we develop a pore partition strategy into COF chemistry, which allows for the segmentation of a mesopore into multiple uniform ultramicroporous domains. The pore partition is implemented by inserting an additional rigid building block with suitable symmetries and dimensions into a prebuilt parent framework, leading to the partitioning of one mesopore into six ultramicropores. The resulting framework features a wedge-shaped pore with a diameter down to 6.5 Å, which constitutes the smallest pore among COFs. The wedgy and ultramicroporous one-dimensional channels enable the COF to be highly efficient for the separation of five hexane isomers based on the sieving effect. The obtained average research octane number (RON) values of those isomer blends reach up to 99, which is among the highest records for zeolites and other porous materials. Therefore, this strategy constitutes an important step in the pore functional exploitation of COFs to implement pre-designed compositions, components, and functions.