Sore loser law

In United States politics, a sore loser law is a law prohibiting the loser in a primary election from then running as an independent or representing another political party in the general election, thus basically blocking them from appearing on the general election ballot (though sometimes they may still run as a write-in candidate).

Some states accomplish the same goal by having simultaneous registration dates for the primary and the general election. Only the states of Connecticut and New York have neither a sore loser law nor simultaneous registration deadlines. Iowa had previously been among this group of states but implemented a sore loser law in 2021.

Richard Winger, a ballot researcher, is of the opinion that in most states these laws do not apply to presidential candidates.

Constitutionality
Opponents have argued that sore loser laws constitute a violation of the Constitution, and have launched court challenges on those grounds. In August 2018, a federal judge sided with the North Carolina affiliate of the Constitution Party in agreeing that the retroactive application of the state's sore loser law was unconstitutional, as applied to the newly formed party.

Gary Johnson case
In Michigan, one of the few states where this law applies to presidential elections as well, Gary Johnson was three minutes late to withdraw from the 2012 Republican Primary and was therefore on the ballot. As a result, he was denied ballot access as a Libertarian.

The Libertarian Party stated that since petitioning in Michigan is by party, not by person, a Texas businessman who is also named Gary Johnson would stand in and run for president as a Libertarian in Michigan, but a U.S. District judge denied their motion.

Gary Johnson was certified as a write-in candidate and received 7,774 votes in Michigan in the general election that year.