Rifaximin is a widely utilized antibiotic in health care centers and hospitals. However, its elimination from wastewater, which prevents health damages, has not been reported so far. In this work, for the first time, a nanocomposite, NiFe2O4/GO, was employed as an adsorbent to remove Rifaximin from an aqueous solution. After synthesis, the XRD, FT-IR, SEM, and VSM techniques were used to confirm the structure of NiFe2O4/GO. We applied response surface methodology to explore the effects of the NiFe2O4/GO and Rifaximin concentrations, as well as solution pH and contact time, on the process performance. We obtained a high coefficient of determination (R2 = 0.994) and satisfactory predictions from the regression model. We obtained the most favorable adsorption rate (93.39%) at a pH of 4.07, a contact time of 5.5 minutes, an adsorbent concentration of 3147.57 mg/L, and a Rifaximin concentration of 68.50 mg/L. The isotherm studies revealed that the adsorption obeys the Freundlich isotherm with a maximum adsorption capacity of 30.12 mg/g for NiFe2O4/GO at 30°C. Thanks to the calculated thermodynamic parameters, it is declared that the process is spontaneous, and the formation of hydrogen bonds and Van der Waals interactions are the dominant interaction terms between the NiFe2O4/GO and Rifaximin. Moreover, the composite maintained an 85.45% removal rate after 4 cycles of regeneration. A removal rate of 89.45% was obtained for effluent from a local pharmaceutical company, representing good efficiency of the adsorbent. In conclusion, NiFe2O4/GO is shown to be a suitable adsorbent for the elimination of Rifaximin from wastewater.