Corrosion of current collectors is one of the most significant issues to tackle in rechargeable magnesium batteries where chloride-abundant electrolytes are commonly used since it can affect the electrochemical performance and the safety of battery system seriously. Here we investigate 1-butyl-1-methylpyrrolidinium chloride ionic liquid as an effective corrosion inhibitor of the current collector in an electrolyte containing magnesium chloride complex. We find that adding just 0.2 wt.% ionic liquid increases the anodic stability of common current collectors by 0.1–0.3 V while maintaining the coulombic efficiencies for Mg deposition and stripping at over 98%. In particular, analytical studies of the passive film formed on 316L stainless steel show that the inhibitor efficiently prevents the formation of corrosion pits and preserves the protective property of the passive film upon repeated anodic scans. Furthermore, the inhibitor enables almost 100% efficiencies in the full cell cycling with Mo6S8 cathode, reflecting higher anodic stability of the current collectors in the electrolyte containing the inhibitor. We propose that the formation of an adsorbed layer of the ionic liquid as a plausible corrosion inhibition mechanism.