The name WD-40 stands for “water displacement, formulation successful in 40th attempt.” Convair, a unit of General Dynamics, first used WD-40 to protect the outer skin of the Atlas missile from rust and corrosion.
Let it sit for 5-10 minutes. Clean another part of the bathroom and the outside of the toilet while you wait. Use a toilet brush to scrub away the stains. Flush the toilet and repeat the steps if necessary.