War brought first-class cricket to an end in 1939, and Yardley joined the first battalion of the Green Howards, along with his Yorkshire team-mate Hedley Verity. After training in Omagh, Northern Ireland, where he played several cricket matches with Verity, he served in India, Iran, Syria, Egypt, Sicily, Italy and Iraq. In January 1944, he was wounded in Italy, rejoining the First Battalion in Iraq on his recovery to become an instructor, before being demobilised at the end of the war.