The invention discloses a preparation method of a microbial fertilizer. The method comprises the following steps: performing pretreatment on a rape seed cake to obtain a first fermentation product; performing pretreatment on straws to obtain a second fermentation product; taking garlic, purslane, herba houttuyniae, mulberry leaves, lotus leaves, bitter gourd vines, pine needles, Artemisia argyi, Oenanthe javanica, Toona sinensis leaves, Allium tuberosum and konjak whole plants, performing pulverization, performing uniform mixing, adding water, performing decoction for 7-8 hours, inoculating photosynthetic bacteria into the filter residues, and performing anaerobic fermentation to obtain a third fermentation product; taking potassium solubilizing bacteria, phosphate solubilizing bacteria, Bacillus subtilis and photosynthetic bacteria, and performing mixing to obtain a mixed microbial inoculant; and mixing the first fermentation product, second fermentation product, third fermentation product and mixed microbial inoculant, soaking the mixture in the filtrate obtained in the step 3 for 2-3 days, spraying sugar water, performing fermentation, stopping the fermentation when the central temperature is higher than 50 DEG C, and performing air drying on the fermentation product, thereby obtaining the microbial fertilizer. By using the microbial fertilizer, the consumption of chemical fertilizers can be obviously reduced; and the microbial fertilizer is capable of loosening the soil, effectively inhibiting diseases and pests and increasing the crop yield per unit area.