To travel as an armed guard next to a vehicle’s driver. The phrase has also been used to mean giving support or aid to someone in a situation, i.e. to “watch their back.”
There is good evidence that people were employed to guard stagecoaches on early USA stateliness. In October 1891, the Iowa newspaper The Oxford Mirror, published this comment: “Of all the devices and inventions for protection of treasure and circumvention of the road agent, the only one that has stood the test of time and experience is a big, ugly-tempered man with a sawed-off shotgun on the box.”
It seems quite plausible that the term ‘riding shotgun’ would have been used in the Wild West, but apparently it wasn’t – not until well after stagecoaches had gone out of use and Hollywood started making westerns about stages being chased by Indians or bad guys in black hats. Although we have 20th century references to people riding on stagecoaches with shotguns from films and newspapers, there are no accounts from the 19th century that call this ‘riding shotgun.’
Apparently the earliest reference in print to people riding shotgun in real life is from the Utah newspaper The Ogden Examiner, May 1919 – headed “Ross Will Again Ride Shotgun on Old Stage Coach.” The article went on to tell how A.Y. Ross would be riding shotgun on an old-fashioned stage coach (made in 1853) on Ogden streets during the day of the Golden Spike celebration.
Express messengers, like A. Y. Ross, were also called shotgun messengers and the guns they used were called messenger shotguns.
The 1950s saw a spate of TV cowboy series in which riding shotgun was so commonplace in the scripts as to be almost obligatory. But riding shotgun in the real sense has moved on since those days. VIPs who travel in limousines are now often flanked by several motorcycle outriders.
Since the September 2001 terrorist attack in New York, US airlines have begun employing air marshals to protect the planes in flight. These have often been described as riding shotgun. I don’t know what they carry as weapons, but it certainly wouldn’t be shotguns. Not in pressurized cabins at 30,000 feet!