The invention provides a method for preparing biogas through mixed anaerobic fermentation of cow dung and corn straw. The method comprises the steps of with the corn straw and the cow dung as raw materials, firstly pretreating the corn straw in a manner of mechanical crushing and basic hydrolysis, then mixing the pretreated corn straw with the cow dung in the mass ratio being (1.5-2) to 1, addingFe2+ according to the quantity being 1.0mg.L<-1>-1.5mg.L<-1>, adjusting the total solid content of a mixture to be 6%-10%, with anaerobic sludge as a fermentation initiator, controlling the anaerobicfermentation temperature to be 20-30 DEG C, and in the fermentation process, performing noncontinuous stirring. The biogas is prepared by the method, fermentation starting is quick, the fermentation period is shortened, the decomposition rate of raw materials is increased, the biogas yield is promoted, the content of methane in gas is increased, and the stability of the fermentation process is increased.