The present invention discloses a preparation method of rare earth complexes containing mesoporous material SBA-15 Schiff base ligands and an application thereof, belonging to the field of environmentally friendly purification; the rare earth complexes have a chemical composition of RE (S-SBA-15) 3, wherein RE represents one or more than one rare earth ion of La3 +, Ce3 +, Pr3 +, Nd3 +, Pm3 +, Sm3 +, Eu3 +, Gd3 +, Tb3 +, Dy3 +, Ho3 +, Y3 +, Er3 +, Tm3 + and Yb3 +; S-SBA-15 is Schiff base; and the structural formula is shown in the figure of the abstract. The preparation method of the rare earth complexes containing mesoporous material SBA-15 Schiff base ligands of the invention is simple, and low in cost; the rare earth complexes have strong bacteriostatic activity, have a minimum inhibitory concentration of less than 120 micrograms per milliliter for both escherichia coli and staphylococcus aureus, and have a broad-spectrum antibacterial property. The rare earth complexes have a large specific surface area and a highly ordered mesoporous structure, which can be used as an antibacterial agent in the field of environmental purification.