The invention discloses a preparation method of an adsorbent based on municipal sludge. The preparation method comprises the following steps: 1) with municipal sludge produced in a municipal sewage treatment process as a sludge raw material, adding calcium oxide, charcoal, fly ash and humic acid into the sludge raw material to form a mixture, and carrying out heating pretreatment; 2) adding N,N-dimethylformamide and Ce-Ni oxide into the pretreated material, conducting uniform stirring to form a mixture, heating the mixture to 120 +/- 5 DEG C in a nitrogen atmosphere, adding hexadecyl dimethyl benzyl ammonium chloride into the mixture after the temperature is within the temperature range, conducting continuous stirring at a constant temperature of 120 +/-5 DEG C after charging is completed, and then performing air-cooling to normal temperature to obtain a mixed material; and 3) adding magnesium oxide, zinc oxide and ferric oxide into the mixed material, uniformly stirring the mixed materials, carrying out heating, preserving heat, and conducting air-cooling to normal temperature after heat preservation to obtain the adsorbent. Compared with an adsorbent in the prior art, the adsorbent prepared by the method has more excellent adsorption activity, and nitrogen and phosphorus elements in sewage can be effectively removed.