The purification of antibiotic compounds-contaminated wastewaters and effluents exhibits the importance of selecting the treatment technologies feasibly. Adsorptive approaches are of tremendous interests in the environmental field mainly due to their outstanding adaptability, large-scaled possibility and ecofriendly sustainability. Herein, we reported the utilization of zeolitic-imidazolate framework (ZIF-8)-derived nitrogen (N)-self-doped mesoporous carbons (ZPC) as a competitive adsorbent for the removal of tetracycline and ciprofloxacin in aqueous solutions. First, ZIF-8 was produced by microwave-assisted synthesis method (450 W, 140 °C, 15 min). N-containing carbons (ZPCx, x = 600, 800, 1000) could be effortlessly reached out through ZIF-8 thermolysis strategy, which the self-sacrificial precursor/template was pyrolyzed at the respective temperatures (600, 800, and 1000 °C). The existence of residual nitrogen in porous carbon structure was observed. Our findings demonstrate that ZPC800 attained a reasonable surface area (268 m2/g) and the superior experimental adsorption capacities (Qexp. = 270.67–317.50 mg/g). The optimal solution pH range was found from 6 for tetracycline to 8 for ciprofloxacin. The experiment was systematically investigated, which the ANOVA analysis were adopted with the confidence level at p < 0.05.