The socialists in Italy were being actively suppressed, much like the French were after 1917 and the rise of Clemenceau. There is no military way to knock Italy out, as others have explained here already. If a reasonable peace offer was made hard on the heels of Caporetto that included status quo peace, or perhaps even the secession of Italian speaking areas, I do think Italy would have been knocked out. However, this would require a completely different mindset in Vienna than historical, which probably would have precluded Italian entry into the war in the first place.
Now for those suggesting that magically a Franco-Italian front would have opened, that is not going to ever happen, ever. Italy depended on England for its coal imports, without which the country collapses economically. They could not afford to make a peace that would involve letting the Austrians fight from their territory (nor could the Austrians logistically sustain it, or want to continue fighting on other mountainous fronts). The Italians would have continued fighting rather than submit to such a peace, as the Entente would have a bloody revenge on them. Besides, once the retreat stopped the Western Allies had already sent several divisions to Italy to shore up the front, though they never really served in major combat operations (the only "fighting" they did was mop up at Vittorio Veneto). Italy did almost all the heavy lifting themselves.