The objective of this study is to assess the efficacy of walnut shell-derived activated carbon with phosphoric acid (WSAC) in the removal of ciprofloxacin (CIP), diclofenac (DC), and sulfamethoxazole (SMX) from aqueous solutions and real wastewater. WSAC was characterized using various analytical techniques such as specific surface area and pore size distribution determination, elemental analysis, SEM images, and FT-IR spectroscopy. The BET-specific surface area of WSAC was determined to be 1428 m2 g−1. The surface is characterized by the presence of irregular pits of varying dimensions and shapes. The adsorption of SMX, CIP, and DC from aqueous solutions using WSAC was tested under various parameters, including contact time, adsorbent dosage, initial concentration, pH, and temperature. The adsorption of SMX, CIP, and DC was found to be in accordance with the Langmuir isotherm model, which suggests that monomolecular adsorption is the predominant mechanism. The maximum adsorption capacities of WSAC towards SMX, CIP, and DC were calculated to be 476.2, 185.2, and 135.1 mg g−1, respectively. The adsorption of SMX, CIP, and DC were found to be consistent with the pseudo-second-order model. Thermodynamic analyses demonstrated the spontaneous and endothermic nature of SMX, CIP, and DC adsorption onto WSAC. The adsorption performances of SMX, CIP, and DC on WSAC were found to be 60.2%, 77.4%, and 74.2%, respectively in the effluent from the municipal wastewater treatment plant. In conclusion, WSAC may be regarded as a readily available, eco-friendly, and efficient substance for the extraction of SMX, CIP, and DC from wastewater and aqueous solutions.