
Wilson delivered his War Message to a special session of Congress on April 2, 1917, declaring that Germany's latest actions had rendered his "armed neutrality" policy untenable. He asked Congress to declare Germany's action to be an act of war. He proposed the United States enter the war, telling Congress that Germany "means to stir up enemies against us at our very doors". He then also warned that "if there should be disloyalty, it will be dealt with a firm hand of repression." Wilson closed his address stating:"The world must be made safe for democracy. We have no selfish ends to serve. We desire no conquest, no dominion. We seek no indemnities for ourselves, no material compensation for the sacrifices we shall freely make."
The declaration of war by the United States against Germany passed Congress by strong bipartisan majorities on April 4, 1917 and it was signed by Wilson on April 6, 1917. The nation's entry into the war was not universally accepted. Antiwar groups, anarchists, communists, Industrial Workers of the World members, and other antiwar groups began to voice their opposition. Many of these groups were targeted by the Department of Justice. Wilson established the United States Committee on Public Information, headed by George Creel, (also known as the "Creel Commission"), which circulated patriotic anti-German appeals and conducted censorship of materials considered seditious.
To further combat disloyalty to the war effort at home, Wilson pressured Congress to pass the Espionage Act of 1917 and the Sedition Act of 1918 to suppress anti-British, pro-German, or anti-war statements. He called for the arrest and deportment of foreign-born enemies. Many recent immigrants or resident aliens without U.S. citizenship, who opposed America's participation in the war, were deported to Russia or other nations under the powers granted in the Immigration Act of 1918.

The Espionage Act of 1917 made it a crime to interfere with the war effort or with military recruitment or to attempt to aid a nation at war with the U.S. The act was opposed in the Senate, almost entirely from Republicans, but from both wings of the party. Henry Cabot Lodge called the legislation an attack on free speech. Hiram Johnson criticized Wilson for failing to use the laws already in place. Former president Theodore Roosevelt voiced opposition as well. Despite the criticism from such notable figures, the final vote for passage was 48 to 26 in the Senate and 293 to 1 in the House of Representatives, with the sole dissenting vote in the House cast by Meyer London of New York. The legislation came late in the war, just a few months before Armistice Day, and prosecutions under the provisions of the Sedition Act were few.
The Sedition Act of 1918 extended the Espionage Act of 1917 to cover a broader range of offenses, notably speech and the expression of opinion that cast the government or the war effort in a negative light or interfered with the sale of government bonds. The Sedition Act of 1918 prohibited the use of "disloyal, profane, scurrilous, or abusive language" about the United States government, its flag, or its armed forces or that caused others to view the American government or its institutions with contempt. Those convicted under the act generally received sentences of imprisonment for five to 20 years. The act also allowed the Postmaster General to refuse to deliver mail that met those same standards for punishable speech or opinion. Though the legislation enacted in 1918 is commonly called the Sedition Act, it was actually a set of amendments to the Espionage Act.
One of the most famous prosecutions under this legislation concerned the Socialist Party leader Eugene V. Debs of Indiana. In June of 1918, Debs was arrested for violating the Sedition Act by undermining the government's conscription efforts. He was sentenced to ten years in prison. He served his sentence in the Atlanta Federal Penitentiary from April 13, 1919, until December 1921, when President Harding commuted Debs' sentence to time served, effective on December 25, Christmas Day. In March 1919, Wilson, at the suggestion of Attorney General Thomas Watt Gregory, released or reduced the sentences of some two hundred prisoners convicted under the Espionage Act or the Sedition Act. He refused to include Debs in this group.
Eugene Debs and the Socialists opposed the war, and especially the draft. They saw the war in terms of class struggle, one in which poor men went off to die in wars so that rich men could prosper. Wilson and leading members of his cabinet were able to convince Congress to pass the Sedition Act, legislation that drastically limited what critics of the war were able to say. Government censors were able to shut down the socialist message using post office censorship and arrest of those advocating open resistance to the draft and other opposition to the war, often on questionable or spurious grounds. At first Debs was able to avoid arrest, but as public pressure mounted from supporters of the war, Debs was arrested following a speech he made in Cleveland. Author Ernest Freeburg in his book Democracy's Prisoner: Eugene V. Debs, The Great War and the Right to Dissent, (reviwed here in this community) argies that one must contort what Debs actually said to find it offensive to the law.
A remarkable aspect of the story of Eugene V. Debs is how the Socialist leader was able to win the respect of the wardens of both institutions that he was incarcerated in, as well as of the inmates, even though political dissenters were considered to be a lower caste in the prison system at the time. Debs was described in near-sainted terms and was allowed to work in the prison hospital and afforded liberties not offered to other inmates. Remarkably, he was even allowed to run for President as the nominee for the Socialist Party in the 1920 election, while still bearing the label "Convict 9653".

As the war ended, the issue of whether or not those imprisoned under the Sedition Act should now become pardoned became one that divided the nation. Efforts were made to win Debs release, first from the Wilson administration, and later from his successor Warren Harding. These began at a time when Wilson's Attorney-General, Mitchell Palmer, mounted a war against the "red scare", also at a time when the world witnessed the Russian Revolution and its results, with mixed opinion, and at a time when many veterans resented the dissenters, while others asserted that free speech was what they were fighting for in the first place. It was also a time when the socialist cause fractured, and when many had differing views of the future of the labor movement. This vast difference of opinion created a political fence that was difficult for those in office to straddle.
With the act rendered inoperative by the end of hostilities, Attorney General A. Mitchell Palmer waged a public campaign for of a peacetime version of the Sedition Act. He sent a circular outlining his rationale to newspaper editors in January 1919, citing the dangerous foreign-language press and radical attempts to create unrest in African American communities. He testified in favor of such a law in early June 1920. Congress took no action on the controversial proposal during the campaign year of 1920. It seemed that the public no longer had an appetite for such a severe restriction on free speech. After a court decision later in June cited Palmer's anti-radical campaign for its abuse of power, the conservative Christian Science Monitor found itself unable to support him.
The U.S. Supreme Court upheld the Sedition Act in Abrams v. United States (1919), although Oliver Wendell Holmes used his dissenting opinion to make a commentary on what has come to be known as "the marketplace of ideas". on would be considered constitutional today.
A lame-duck Congress repealed the Sedition Act on December 13, 1920. Many continue to debate these extreme restrictions placed on the right of freedom of speech and freedom of the press (especially the socialist press) as a controversial part of Woodrow Wilson's legacy.