^ these answers I've given may be pertinent to the topic
To answer your question and /u/keloyd, the saying "War To End All Wars" seems to have originated from HG Wells, who wrote about a "War That Will End War" in August 1914. Being a well known socialist, with somewhat utopian visions of the future as evidenced by his other writings, it's not surprising that such a saying found it's way around. If the 'Peace Ballot' of the 1930s is any indication (as seen in David Reynold's documentary [here] (https://www.youtube.com/watch?v=IZdJ4Opk4TI)), the saying was probably at least common knowledge in the 1920s and 1930s.
What can be said is that it was not likely the majority opinion during the war; the Allied nations had various war aims which coalesced after 1917 and American entry, one of which was the League of Nations. The whole concept of the League of Nations was not that it would do away with disputes and discord altogether, but that it would prevent confrontations between nations from escalating into war.
As to how many people believed it, that's difficult to say. There was what many have called the "spirit of Locarno" after the Locarno treaty of 1926, which helped to settle any potential border disputes between Germany and it's western neighbours. However, given that most popular views of the war at least in Britain were that it had been a just cause, based on research by Brian Bond and Rosa Maria Bracco into war books of the day, it seems unlikely that such a utopian view of a "War To End All Wars" was widely held, at least amongst the public.
What seems more likely is that this saying, like "Home by Christmas," "Lions Led By Donkeys" and "Kitchener Wants You" was seized upon by popular history and culture in the 1960s, when the study of the history (or "history") of the War really took off. It tells us just as much about the anti-war sentiments of 1960s counter-culture as it does about what people really though about WWI in the 1920s and 1930s.
Followup question - how many people believed this, and to what extent? There are innumerable examples back to the Roman Empire of high toned, meaningless rhetoric that the right people just have to say.