The invention discloses a method for treating smelting wastewater containing heavy metals. The method comprises the following steps: 1, the smelting wastewater containing heavy metals is pretreated to remove particulate impurities in the wastewater and adjust the wastewater to be acidic; 2, the wastewater is transferred to an iron-carbon micro-electrolytic reactor to be subjected to single-stage or multi-stage micro-electrolytic electrochemical treatment under acidic conditions to remove most heavy metal ions in the wastewater, the wastewater is adjusted to be weakly alkaline or alkaline, is subjected to single-stage or multi-stage chemical flocculation treatment to further remove other heavy metal ions, and pollutants of arsenic, fluorine, chlorine and the like in the wastewater; and 3, solid-liquid separation is carried out to obtain production water which can be recycled. The method comprises steps of wastewater pretreatment, iron-carbon micro-electrolysis, chemical flocculation and solid-liquid separation which are organically coupled in series. The method which organically combines the micro-electrolysis with the chemical flocculation and allows them to mutually cooperate with each other and co-perform effects has the advantages of simple treating process and technology, low treatment cost, high treatment efficiency, and standard-reached discharge and recovery of the treated wastewater.