Scottish pork taboo
The Scottish pork taboo is a purported historical taboo against the consumption of pork amongst the Scottish people, particularly Highlanders. The phrase was coined by journalist Donald Alexander Mackenzie, who believed the aversion stemmed from an ancient taboo. 

Several writers who confirmed that a prejudice against pork existed, or a superstitious attitude to pigs, do not see it in terms of a taboo related to an ancient cult. Any prejudice is generally agreed to have been fading by 1800. Some writers attribute a scarcity or dislike of pork in certain periods to a shortage of pig fodder.

Mackenzie's ideas
Donald  Mackenzie gave a lecture on the Scottish pork taboo in 1920  when he explained his idea that prejudices against pork-eating could be traced back to a centuries-old religious cult. When he published these theories in the 1930s, he suggested the taboo was imported to Scotland in pre-Roman times by Celtic mercenaries, influenced by the cult of Attis in Anatolia. (The cult of Attis did not abstain permanently from pork; it was a purification for their ceremonies.)

He dismissed any possibility that the pork taboo originated from a literal reading of the Bible, and disputed this with various arguments, noting that early Christian missionaries did not snub pork. He conceded that  archaeological evidence was found of pigs being eaten in prehistoric Scotland, but suggested this might have come from pork-eating peoples living near others who did observe the taboo, or be related to ceremonial use of pigs. Later pork production was for export, not for local use, just as eels were caught to send to the English market, while they were unacceptable as food in Scotland. The taboo died out in the Lowlands earlier than in the Highlands, and by the 1800s, most crofts in the Highlands and Islands would have kept a grice.

Other folklorists, such as Isabel Grant, have accepted this theory of a taboo.

Writers cited by Mackenzie
In addition to proposing ideas developed from studying the mythology and folklore of Scotland and other cultures, Mackenzie quoted writers of the 18th and 19th centuries.

Walter Scott referred to Scottish Highlanders' dislike of pork in more than one book, and around 1814 explained that
Pork or swine’s flesh, in any shape, was, till of late years, much abominated by the Scotch, nor is it yet a favourite food amongst them. King Jamie carried this prejudice to England, and is known to have abhorred pork almost as much as he did tobacco.

Scott's remark that Ben Jonson "recorded" the king's aversion to pork in his masque The Gipsies Metamorphosed, when the king has his hand read, is based on these words: 
You should, by this line,
Love a horse and a hound, but no part of a swine.

Samuel Johnson found an "abhorrence" of pork and bacon on Skye in the 1770s.
It is not very easy to fix the principles upon which mankind have agreed to eat some animals, and reject others; and as the principle is not evident, it is not uniform.  […] The vulgar inhabitants of Sky, I know not whether of the other islands, have not only eels, but pork and bacon in abhorrence, and accordingly I never saw a hog in the Hebrides, except one at Dunvegan.

Mackenzie suggested that a verse in the English satirical song "The Brewer" from A Collection of Loyal Songs referred to the taboo:
The Jewish Scots that scorn to eat
    The flesh of swine and Brewer's beat
    'Twas the sight of this hogshead made 'em retreat
    Which nobody can deny!

He believed that this, and other comments associating Scots with Jews, confirm the existence of the taboo, but have nothing to do with its origin. However, Celtic Christians had long faced accusations of 'judaizing'.

He described a superstition about touching or saying "cauld airn" (cold iron) when  pigs are mentioned. This was discussed by Dean Ramsay, and is also included in Walter McGregor's Notes on the folk-lore of the north-east of Scotland (Folklore Society 1881).
Among the many superstitious notions and customs prevalent among the lower orders of the fishing towns on the east coast of Fife, till very recently, that class entertained a great horror of swine . . . .

Mackenzie disagreed with Edward Burt, whose Letters from a Gentleman in the North of Scotland (1754) discusses an “aversion” to pork in the Highlands, but says it is not “superstitious”.

Other writers referring to a prejudice against pork

Bishop John Lesley's History of Scotland talks of "our cuntrie peple" having "lytle plesure" in pork in the 1570s. In contrast to the alleged tastes of country folk, pigs were supplied to the royal household for the table of Mary, Queen of Scots from former monastic lands.

At least four ministers writing about their parishes for the Statistical Accounts of Scotland in the 1790s speak of a prejudice which is starting to fade: for instance, "The deep rooted prejudice against swine's flesh is now removed: most of the farmers rear some of that species, which not 30 years ago, they held in the utmost detestation."  (Ardchattan, County of Argyle) Account of 1791-99, volume 6, page 177)

Twentieth-century historian Christopher Smout speaks of "a universal superstitious prejudice".

An archaeological survey of pork consumption in Scotland by the Society of Antiquities in Scotland in 2000 states: "Whether there is any archaeological evidence of this prejudice against pigs, for whatever reason, is open to question." and that "During the medieval period, it has been noted that rural sites contained more pig bones than urban sites, and that the lowest relative frequencies come from the most southerly of the burghs considered, Peebles and Perth. This contradicts the notion that it was the ‘Highlanders’ who abhorred pork, unless it is assumed that, despite this dislike, they continued to produce it for sale to others."

Writers disputing Donald Mackenzie's theories
Historian William Mackay Mackenzie published his thoughts in the Scotsman letters pages (8 October 1921) as part of a long-running debate arising from D. A. Mackenzie's lecture in 1920. While agreeing there had been a "sporadic prejudice" against pork in parts of Scotland, and offering illustrations of this, he was against the idea of a link to a "religious cult". He saw economic factors at work between 1500 and 1800 which would discourage pig-keeping. He cited several examples of pork consumption  in the Middle Ages, and described a "temporary lapse" when "the great forests disappeared from Scotland".

In 1983, American anthropologist Eric B. Ross put forward arguments based on a detailed study of Scottish agricultural history, and asserted the value of  cultural materialism rooted in evolutionary anthropology for studying dietary customs, thus avoiding explanations based on "relatively esoteric" beliefs. Because of deforestation, a loss of beech mast and acorns for  feeding pigs occurred, and potatoes were not produced in sufficient quantity to offer a useful alternative until the late 18th century. Throughout this gap in pork consumption by the general population, many of the Scottish upper classes continued to eat the meat. He summed up:

In the years of the 18th century and probably earlier, swine were rarely raised in Scotland, particularly in the Scottish Highlands, and subsequent writers have gone so far as to postulate the operation of a taboo on the eating of pork. Unfortunately there is almost nothing known today about local sentiments of that era, and we have only the intellectual rationalizations of educated writers who all too easily found an explanation for the scarcity of pigs in the assumption that a 'foolish prejudice' was at work.

See also
 Grice
 Halal
 Kashrut
 Pork in Ireland
 Taboo food and drink
 Horse meat

Notes

References
P. W. F. Brown,  The Luxuriant Pig in  Folklore, volume 76, no. 4 (Winter  1965), pp 288–300; JSTOR link
Donald A. Mackenzie, Scottish folk-lore and folk life: studies in race, culture and tradition (Blackie 1935)
Eric B. Ross  The Riddle of the Scottish Pig in BioScience,  volume 33, no. 2 (Feb 1983), pp 99–106; JSTOR link
Scotsman archives
Statistical Accounts of Scotland

Further reading
Donald A. Mackenzie, Wonder Tales from Scottish Myth and Legend - Introduction: "...pigs were, it seems, sacred animals..."
Donald A. Mackenzie, Egyptian Myth and Legend, chapter 5: "The Devil Pig in Egypt and Scotland"
A Collection of Loyal Songs

Scottish taboo
Scottish cuisine
Scottish folklore
Taboo