Slfamethoxazole (SMX) has been considered as one kind of important micropollutants in water which need to be removed effectively. Developing one kind of material for effectively removing SMX in water is crucial in treatment process. In this study, core–shell structured metal–organic frameworks (MOFs) with increasing shell thickness (5, 10, and 20-ZIF-8@ZIF--67 s) were selected as an ideal platform to develop water-stable hierarchical porous carbons (HPCs) using one-step calcination, showing the dual functionals of both adsorption and catalysis by producing large amount of acitve species (1O2). These novel HPCs systematically optimized at increasing temperatures and ratios of two metals. The 10-Co-NHPC-900 at optimal conditions shows highest adsorption capacities and initial adsorption rates, which are 4.56 and 10.35 times higher than those of calcinated ZIF-67 s. The decomposition mechanisms based on PMS were systematically studied by analyzing oxidant consumption, reactive oxygen species and by-products of SMX. In addition, Co ions leached amount of 10-Co-NHPC-900 was 63.6 times lower than that of MOF precursor, indicating that the cobalt-based porous carbon have higher water stabilities. This study offers an efficient approach for reducing micropollutants risk using water-stable hierarchical porous carbons.