I recently watched a show where some Jacobite soldiers in 1746 were equipped with boar spears and was wondering if it was common for spears to be used during the 16th-18th centuries, particularly in Scotland and Ireland.
No, shorter spears could not replace pikes. Pikes were supposed to be around 16 feet long. Soldiers of the English Civil War would sometimes make the mistake of trimming them shorter for easier handling, but they did not work nearly as well. At the 1646 Battle of Benburb, in the Irish Confederate War, the Scots tried to use pikes that were a couple of feet shorter than those of the Irish. They also had broadheaded points, instead of the small, four-square points that were better for piercing, and the Irish pike also had the point mounted with iron strips for some feet on either side of the shaft. That made it harder for it to be broken off, or the shaft to be hacked with a sword. When it came to " push of the pike", the Scots were defeated.
By the '45 Highland uprising in most armies pikes had been replaced by bayonets on muskets. If any polearms were used in Scotland then, they likely were Lochaber axes. Those , mixed with swordsmen equipped with shields, could make a pretty effective force for close fighting- but could do nothing against volleys from muskets.
Firth, H. C. (2020). Cromwell’s army : a history of the English soldier during the Civil Wars, the Commonwealth and the Protectorate. Alpha Editions.