A completely biological method for removing a first group of micropollutants of pharmaceutical origin and a second group of micropollutants of pharmaceutical origin from wastewater, the method comprising the steps of: - providing a first buffer tank upstream of the bioreactor; - providing a moving bed membrane bioreactor (MB-MBR) for developing biomass growth both on a fixed support and in suspension in the form of flocs, and on mobile supports, said bioreactor being configured to obtain an effluent with a COD concentration of organic matter of less than 50 mg l -1 and a total nitrogen concentration of less than 15 mg l -1; - providing a biofiltration tank, separate from the tank of the bioreactor, comprising one or more biologically activated carbon columns containing activated carbon; - supplying the first buffer tank upstream of the bioreactor with wastewater comprising micropollutants of pharmaceutical origin; - pretreating said wastewater comprising micropollutants of pharmaceutical origin by passing it through a fine mesh sieve, so as to retain particles having a diameter greater than 1 mm; - in a first treatment, introducing the wastewater, once sifted, into the populated bioreactor possibly seeded with a first microbial consortium located and/or developing on the fixed parts and in suspension in the form of flocs, and on the mobile supports, during a first retention time; - introducing a second microbial consortium in the biofiltration tank; - in a second treatment, introducing the wastewater treated by the bioreactor into the biofiltration tank and allowing the residues of micropollutants of pharmaceutical origin to be adsorbed onto the activated carbon; - allowing the activated carbon which has previously adsorbed the residues of micropollutants of pharmaceutical origin to be colonized by the second microbial consortium in the form of biofilms, allowing said residues to be biodegraded by the second microbial consortium and allowing the activated carbon to bioregenerate, during a second retention time; - discharging the treated wastewater into the environment, the total hydraulic retention time, consisting of the sum of the first retention time and the second retention time, being determined to obtain an average purification efficiency of the micropollutants of pharmaceutical origin of the first group in the treated wastewater greater than 80%, preferably greater than 95%, and an average purification efficiency of micropollutants of pharmaceutical origin of the second group greater than 40-50%, with reference to their content (C 0) in the raw wastewater; the method comprising the following additional steps: - providing a second buffer tank inserted between the moving bed membrane bioreactor (MB-MBR) and the biofiltration tank; - in normal operation, supplying the second buffer tank with the effluent from the first treatment and supplying the second treatment from the second buffer tank; - performing separate backwashing of the membranes of the bioreactor and of the biologically activated carbon, without communication thanks to the buffer tank. - providing a first buffer tank upstream of the bioreactor; - providing a moving bed membrane bioreactor (MB-MBR) for developing biomass growth both on a fixed support and in suspension in the form of flocs, and on mobile supports, said bioreactor being configured to obtain an effluent with a COD concentration of organic matter of less than 50 mg l -1 and a total nitrogen concentration of less than 15 mg l -1; - providing a biofiltration tank, separate from the tank of the bioreactor, comprising one or more biologically activated carbon columns containing activated carbon; - supplying the first buffer tank upstream of the bioreactor with wastewater comprising micropollutants of pharmaceutical origin; - pretreating said wastewater comprising micropollutants of pharmaceutical origin by passing it through a fine mesh sieve, so as to retain particles having a diameter greater than 1 mm; - in a first treatment, introducing the wastewater, once sifted, into the populated bioreactor possibly seeded with a first microbial consortium located and/or developing on the fixed parts and in suspension in the form of flocs, and on the mobile supports, during a first retention time; - introducing a second microbial consortium in the biofiltration tank; - in a second treatment, introducing the wastewater treated by the bioreactor into the biofiltration tank and allowing the residues of micropollutants of pharmaceutical origin to be adsorbed onto the activated carbon; - allowing the activated carbon which has previously adsorbed the residues of micropollutants of pharmaceutical origin to be colonized by the second microbial consortium in the form of biofilms, allowing said residues to be biodegraded by the second microbial consortium and allowing the activated carbon to bioregenerate, during a second retention time; - discharging the treated wastewater into the environment, - providing a second buffer tank inserted between the moving bed membrane bioreactor (MB-MBR) and the biofiltration tank; - in normal operation, supplying the second buffer tank with the effluent from the first treatment and supplying the second treatment from the second buffer tank; - performing separate backwashing of the membranes of the bioreactor and of the biologically activated carbon, without communication thanks to the buffer tank.