The novel synthesis of task-specific ionic liquids (TSILs) introducing piperazine substructures was described. Piperazine functional groups were easily grafted onto an imidazolium cationic derivative via a simple four-step process starting from available materials such as imidazole, ethylene glycol, and 1-butylamine or 3-dimethylaminopropylamine. Effects of pH, temperature, and structure of functional groups on the performance of liquid–liquid extraction of Cu2+, Ni2+, and Co2+ from water were investigated. It was found that TSILs were efficient for removal of these metal ions in mild acid solutions. The TSIL with an extra nitrogen atom showed a higher capability to separate metal ions, especially for Cu2+. This may be ascribed to the intrinsic structure of the functional groups – the more coordination sites, the higher the affinity for the metal ions. Furthermore, the thermodynamics indicated that the extraction process was exothermic and spontaneous in nature.