A strategy of utilizing Cu2+-mediating interaction to prepare magnetic imprinted polymers for the selective detection of celastrol in traditional Chinese medicines.