Fearing that anti-war speeches and street pamphlets would undermine the war effort, President Woodrow Wilson and Congress passed two laws, the Espionage Act of 1917 and the Sedition Act of 1918, that criminalized any “disloyal, profane, scurrilous, or abusive language” about the U.S. government or military, or any speech intended to “incite insubordination, disloyalty, mutiny, or refusal of duty.” The previous Alien and Sedition Acts passed in 1798 had been mostly repealed or had expired by 1802.
The two broadly worded laws passed in 1917 and 1918 ultimately came to be viewed as some of the most egregious violations of the Constitution’s free speech protections ever. They were written in an environment of wartime panic, and resulted in the arrest and prosecution of more than 2,000 Americans, some of whom were sentenced to 20 years in prison for sedition.
A handful of those convictions were appealed to the Supreme Court, which upheld the Espionage and Sedition Acts as constitutional limits on free speech in a time of war. The famous decision penned by Justice Oliver Wendell Holmes introduced the “clear and present danger” test, which he compared to shouting “fire!” in a crowded theater.
You can read more about this by clicking here.