The invention relates to a preparation method of a sandwich-structure magnetic mesoporous imprinted material capable of separating lanthanum, cerium, praseodymium or neodymium. A superparamagnetic Fe3O4 nanocluster is synthesized by a hydrothermal method; and in combination with a cetyltrimethylammonium bromide template method and by adopting lanthanum, cerium, praseodymium or neodymium ions as template ions and siloxane with a functional group as a functional monomer, a molecularly imprinted mesoporous material with high selectivity on the lanthanum, cerium, praseodymium or neodymium ions is synthesized by a silicate ester sol-gel method. The invention has the following advantages: the sandwich-structure magnetic mesoporous imprinted material capable of separating lanthanum, cerium, praseodymium or neodymium has specific identification ability on lanthanum, cerium, praseodymium or neodymium, has high magnetic responsibility, high adsorption capacity, high adsorption rate and strong acid-base resistance, and can realize efficient enrichment and separation of lanthanum, cerium, praseodymium or neodymium while the liquid-solid separation process is simplified.