The invention discloses a method for preparing a lignin-based dispersing agent by purifying pulping black liquor through a capacitive deionization method. The preparation method comprises the following steps of (1), adding the pulping black liquor into a reactor, removing a charged impurity in the pulping black liquor with a direct-current voltage of 1.0V to 3.0V by using an electrode, making the pulping black liquor flow through the electrode at a flow speed of 0.1m / min to 0.5m / min, interrupting a power supply once per 5min to 30min to clean the electrode, then recycling the electrode again, and treating a raw material of the pulping black liquor; (2), adding the pulping black liquor from which the charged impurity is removed into another reactor, raising temperature to 60 to 80 DEG C, adding an oxidant into the another reactor, making an obtained first mixture react for 0.5h to 2.0h, afterwards, adding an aldehyde type compound into the another reactor, making an obtained second mixture react for 0.5h to 3.0h at 60 to 100 DEG C, then adding a sulfonating agent into the another reactor, making an obtained third mixture react for 2.0h to 5.0h at 90 to 130 DEG C, then regulating the PH (Potential of Hydrogen) of a reaction system to be 11 to 13, adding sodium hypophosphite into the another reactor, making an obtained fourth mixture react for 1.0h to 4.0h at 80 to 120 DEG C, then adding a quaternizing agent into the another reactor, making an obtained fifth mixture react for 1.0h to 4.0h, then carrying out cooling and discharging to obtain a black-brown liquid product, and drying the black-brown liquid product, so that powder of the lignin-based dispersing agent is obtained.