The invention relates to a metal oxide nanometer material for treating wastewater containing dyes or heavy metal ions, a preparation method and application thereof. Compositions of the metal oxide nanometer material is one or a mixture of more than two of CaO, ZrO2, SiO, ZnO, TiO2, MgO, Fe2O3 and NiO. The preparation method comprises the following steps: dissolving one or a mixture of more than two of calcium nitrate containing crystallization water, zirconium nitrate, ethyl orthosilicate, zinc nitrate, butyl titanate, magnesium nitrate, ferric nitrate and nickel nitrate into methanol, ethanol or propanol, adding a phenylcarbinol or benzylcarbinol structure-directing agent into the obtained solution, moving the mixture into a high-pressure kettle after the mixture is mixed evenly, heating the mixture to between 120 and 200 DEG C for 2 to 6h to ensure that nitrate is completely alcoholized under the protection of chlorine gas with the pressure of between 10 and 1.5*10 Pa, then heating the mixture to between 261 and 269 DEG C for 15h, drying the obtained product, and then performing high-temperature roasting at a temperature of between 300 and 500 DEG C to obtain the metal oxide nanometer material. The metal oxide nanometer material is added into the wastewater containing the dyes or the heavy metal ions to ensure that the metal oxide nanometer material and the wastewater are fully contacted to decolorize, absorb or degrade the wastewater containing the dyes.