The invention discloses a method for production of an organic fertilizer by utilizing pig manure. The method comprises the following steps: A, pretreatment of raw material: the pig manure is used as raw material, the carbon-nitrogen ratio is adjusted to 28, the moisture content of the raw material is reduced to 60 percent, and EM strains are added; B, compost fermentation: compost fermentation is performed by adopting an aerobiotic windrow type composting technology; C, postprocessing of compost products: the moisture is reduced to be below 30 percent, particles can pass through a sieve with 60 mesh, and microelements or functional microorganisms are add for adjustment; D, packaging and storing of finished products. The organic fertilizer produced with the method is excellent in product quality, and is in strict conformance with the national standards and industrial standards of the commercial organic fertilizer: the organic content is not less than 45 percent, the total nutrient content is not less than 5 percent, the moisture content is not greater than 30 percent, and the pH value is 5.5-8.5; the death rate of ova of roundworms is not less than 98 percent, and the number of manure coli-group is not greater than 50 unit / g; in the produced organic fertilizer, in per kilogram of dry matters, the heavy metal content standards of the product are as follows: As is not greater than 30, Hg is not greater than 5, Pb is not greater than 100, Cd is not greater than 3 and Cr is not greater than 300.