Slow-release hydrogel can effectively improve nutrient content of soil and reduce evaporation rate of the water. However, petroleum-based hydrogels will cause secondary pollution to soil. Herein, the nitrogen content of aminated lignin reached 7 % by Mannish reaction with microwave heating, and the influence of microwave heating on the aminated process of lignin was investigated. Afterwards, lignin-based ternary composite hydrogel (sodium alginate (SA)/sanxan(SX)/aminating lignin (OLS)) was successfully prepared using all-biomass sources. The slow-release hydrogel with optimal water absorption, water retention and slow-release properties can be obtained by adjusting the ratio of SX and OLS. The maximum water absorption capacity of hydrogel with rich pore structure can be as high as 91.9 g/g and can still reach 88.95 g/g after 8 times of recycling. The addition of SA/SX/OLS into soil increased the maximum water holding capacity and water retention by 27.88 % and 42.66 %, respectively. Besides, the effects of SA/SX/OLS on physical and chemical properties of soil were explored, and the soil improvement mechanism by the ternary composite hydrogel was also proposed. This work offered a novel strategy to enhance soil fertility by adding SA/SX/OLS composite hydrogel to the soil, Making it of great value in the field of sustainable agricultural development.