Seawater electrolysis to produce hydrogen is a critical technology in marine energy projects; however, the severe anode corrosion caused by the highly concentrated chloride is a key issue should be addressed. In this work, we discover that the addition of sulfate in electrolyte can effectively retard the corrosion of chloride ions to the anode. We take nickel foam as the example and observe that the addition of sulfate can greatly improve the corrosion resistance, resulting in prolonged operating stability. Theoretical simulations and in situ experiments both demonstrate that sulfate anions can be preferentially adsorbed on anode surface to form a negative charge layer, which repulses the chloride ions away from the anode by electrostatic repulsion. The repulsive effect of the adsorbed sulfate is also applicable in highly-active catalyst (nickel iron layered double hydroxide) on nickel foam, which shows ca. 5 times stability of that in traditional electrolyte.