Magnetic lignin nanoparticles (MLNs) were prepared by inducing their self-assembly through lignin regeneration in the [N-methyl-2-pyrrolidone][C1–C4 carboxylic acid] ionic liquids ([NMP]ILs), which are low-cost protic ionic liquid. [NMP]ILs are self-assembling solvent that can enhance the adsorption capacity of MLNs to a greater degree than tetrahydrofuran or H2O. Additionally, the anion types of [NMP]IL greatly influence the physiochemical properties of MLNs. The MLNs prepared through self-assembly with [NMP][formate] (MLN/[NMP][For]) exhibited a higher maximum adsorption capacity (134.53 mg/g) than the [NMP]ILs of C2–C4 carboxylate anions. MLN/[NMP][For] demonstrated stable adsorption within a pH range of 6–10 or at high salt concentrations (0.01–0.5 mol/L), retaining over 80 % of its regeneration efficiency after 5 cycles. In addition, MLN/[NMP][For] selectively removed cationic dyes in mixed binary anionic–cationic dye solutions. This work demonstrated the feasibility of preparing magnetic biosorbents with good selectivity and stability though regeneration and by adjusting the anions of ionic liquids.