Two-dimensional metal-containing covalent organic frameworks (COFs) have been employed as electrocatalysts. However, the metal sites were stacked within the layers with strong interactions, which hindered mass transport to them in the catalytic process. Herein, we constructed a pore-confined catalyst in a vinylene-linked COF for the oxygen reduction reaction (ORR) via the Katritzky reaction. By anchoring the catalytic sites along the pore walls with covalent bonds, the catalytic units were well-exposed during the catalytic process and retained crystallinity and porosity, facilitating mass access to the metal sites. In addition, the electron/charge transported from the framework to the metal units modulated the electronic states, thus improving the catalytic activity. The catalytic COF exhibited a half-wave potential of 0.85 V and a mass activity of 109.7 A g–1, which are better than those of other reported COFs. Theoretical calculations revealed that the interaction between the framework and metal sites contributed to the easy formation of OOH* and OH*, resulting in high activity. This work provides insights into designing catalytic COFs based on C═C linkages.