BACKGROUNDGraphite‐like biochar of NWSC600K was prepared at 900 °C using walnut shell as the raw material and aqueous ammonia (NH3·H2O) as an activator, and characterized using transmission and scanning eletron microscopy (TEM, SEM), X‐ray diffraction (XRD), Brunauer–Emmett–Teller (BET), Raman spectroscopy and Fourier transform infrared (FTIR). The study investigated the adsorption performance and mechanism of NWSC600K for ciprofloxacin (CIP).RESULTSThe results showed that extremely tiny pores were found on the surface of NWSC600K, which increased its specific surface area to 823.91 m2 g−1, whereas the average pore size of NWSC600K decreased to 3.23 nm. The results of TEM, XRD and Raman spectroscopy detected well‐arranged lattice stripes as well as characteristic peaks corresponding to the graphite lattice appearing on the surface of NWSC600K. Moreover, the ID/IG value for NWSC600K was 1.429. The FTIR results showed that functional groups including the amino group were formed on NWSC600K.CONCLUSIONThe adsorption capacity of NWSC600K for CIP was 158.14 mg g−1 and the corresponding removal rate was 97.5% at pH 7. The pH value impact on the removal efficiency of CIP greatly, and the removal rate of CIP decreased linearly with increasing pH. The coexisting ions also would inhibit the adsorption of CIP on NWSC600K. Results obtained from kinetic and isotherm models, thermodynamics and characterization analyses suggested that pore‐filling, π–π stacking, hydrogen bonding, hydrophobicity and electrostatic interaction existed during the adsorption process. The adsorption was a nonspontaneous exothermic reaction. © 2024 Society of Chemical Industry (SCI).