A microporous covalent-organic polymer (triazine polymer, referred to as MCTP), was synthesized and subsequently carbonized, after loading urea and KOH (serving as an additional nitrogen source and activator, respectively), through high-temperature pyrolysis. This process resulted in materials named KUCDCs, which exhibited high porosity and a broader range of pore sizes compared to carbon materials produced without the addition of urea and KOH, referred to as CDC. KUCDCs, CDC, and commercially available activated carbon (AC) were evaluated for their ability to remove sulfonamide drugs, sulfamethoxazole (SMX) and sulfachlorpyridazine (SCP), from aqueous solution. Among these materials, KUCDC-800, which was carbonized at a temperature of 800 °C, demonstrated superior adsorption performances for sulfonamides, attributed to its high porosity, nitrogen content, and presence of surface oxygen groups. The adsorption capacities for SMX and SCP on KUCDC were notably higher than those on AC and MDC, with maximum capacities (Q0) of 619 and 554 mg/g for SMX and SCP, respectively. Notably, KUCDC-800 stands out as a recyclable adsorbent with the highest reported Q0 for SMX to date under near-neutral conditions. The exceptional performance of KUCDC in adsorbing SMX could be explained by its high porosity and surface functionalities for hydrogen bonding interactions with the adsorbate.