Photocatalytic oxidative coupling of amines is considered a mild, efficient, and sustainable strategy for the synthesis of imines. As a versatile organic semiconductor, conjugated microporous polymers (CMPs) are attractive in photocatalysis areas due to the diversity of their polymeric monomers. Herein, we report that in addition to the design of monomers, size-confined polymerization is also a feasible strategy to modulate the structure and photocatalysis properties of CMPs. We adopted dibromopyrazine as polymeric units to prepare pyrazine-involved hollow spherical CMPs (H-PyB) using a template method and successfully performed size-confined polymerization of hollow samples by resizing the templates. Interestingly, the small confinement space induced the formation of CMPs with better conjugate extensibility, resulting in enhanced conductivity, narrowed bandgaps, improved photoelectric performance, etc. As a result, small-sized H-PyB CMPs had superior activity for the photocatalytic oxidation of amines. Particularly, the smallest H-PyB CMPs that we designed in the present work exhibited excellent performance for the photocatalytic coupling oxidation of amines. When using benzylamine as a model substrate, the yield of the corresponding imine reached ∼ 113 mmol·g−1·h−1, accompanied by almost 100 % selectivity. Furthermore, the as-designed confined samples exhibited stable photocatalytic activity as well as good applicability for oxidative coupling of different amines. This work not merely reports a kind of CMP photocatalysts with excellent performance for the imine coupling oxidation but also proposes an alternative strategy for constructing high-performance organic photocatalysts by size-confined synthesis.