Designing adsorbents for the efficient separation of challenging gas pairs, such as C2H2/C2H4 and C2H2/CO2, is a crucial yet demanding goal in separation science. Here, we implemented a pore-engineering strategy to tailor the pore environment of a metal-organic framework (MOF) via functional groups, thereby enhancing its C2H2/C2H4 and C2H2/CO2 selectivity performance. The introduction of hydroxyl (-OH) groups into Ni7-MOF not only reduces pore dimensions but also promotes a multitude of guest-host interactions within the confined pore environment. The hydroxyl-functionalized Ni7-OH demonstrates high selectivity for C2H2 over C2H4 and CO2 between 273 and 308 K. Dynamic breakthrough experiments further confirm its dual-functional capability. Compared to Ni7-MOF, Ni7-OH not only delivers superior ethylene-purification efficiency but also enables highly effective C2H2/CO2 separation, allowing high-purity C2H2 (>99.9%) to be recovered through mild temperature-swing desorption. The introduction of hydroxyl groups fine-tunes the binding environment, differentially strengthening the key C–H∙∙∙Ni interaction that favours C2H2 over C2H4 and CO2, as supported by density functional theory (DFT) calculations. With its excellent stability, regeneration ability, and balanced performance, Ni7-OH represents a promising adsorbent for energy-efficient C2H2 removal from C2H4 streams and C2H2 recovery from C2H2/CO2 mixtures.