The Laird o' Cockpen is a song written by Carolina Oliphant, Lady Nairne (1766–1845), which she contributed anonymously to The Scottish Minstrel, a six-volume collection of traditional Scottish songs published from 1821 to 1824. Much of the Scottish poetry in Carolina's time was concerned with writing genteel verses for somewhat bawdier earlier songs, and The Laird o' Cockpen is no exception, being set to the music of "O when she cam' ben she bobbit".
 Nairne's family and upbringing was staunchly Jacobite. In that vein, "The Laird o' Cockpen", expresses something of the Jacobite distaste for the Whiggish displays and manners of the nouveau riche in post-Union Scotland.
 The song has a Roud Folk Song Index number of 2859.
 Carolina Nairne was born to a Jacobite family in 1766, two years after her parents were allowed to return to Scotland from their exile in France following the defeat of the Jacobite army at the Battle of Culloden. Her grandfather, Lord Nairne, had commanded the second line of the Jacobite army at the Battle of Prestonpans in 1745, and her father was an aide-de-camp to Bonnie Prince Charlie.
 The Laird o' Cockpen was a real historical figure, with an estate at Cockpen in Midlothian. Having fought on the Royalist side at the Battle of Worcester in 1651, the final battle of the English Civil War, he accompanied King Charles II to Holland after the defeat by Parliamentary forces. He became one of the King's favourites, but following the restoration of the monarchy in 1660, Cockpen discovered that his estate had been confiscated, and that an ungrateful King refused to answer his petitions for its return. But by a stratagem[further explanation needed] he succeeded in re-establishing his familiarity with the King, who restored him to his lands.
 Nairne probably wrote "The Laird o' Cockpen" as a young woman, still living in her birthplace, the Auld Hoose in Gask, Perthshire. Perhaps unsurprisingly given her family background and upbringing, the majority of Nairne's more than 80 songs have Jacobitism as their backdrop, but not always so explicitly displayed as in "Charlie is my darling" or "Will ye no' come back again?" for instance. "The Laird o' Cockpen" is also in that tradition, subtly expressing Jacobite distaste for the Whiggish displays and manners of the nouveau riche in post-Union Scotland.
 The song was first published in volume 3 of The Scottish Minstrel (1821–1824). It was a favourite of Queen Victoria who requested that it be included in a concert given in her honour during her visit to Taymouth Castle in 1842. Her high opinion of the song was not shared by everyone: literary critic Stanley Edgar Hyman, for instance, considered it to be "uninteresting".
 As written by Nairne, the lyrics are in seven stanzas.
 The song is set to the tune of "O when she cam' ben, she bobbit", a song that also has the laird o' Cockpen as its main protagonist. The music's alternating 6/4 and 3/2 rhythms are in passamezzo antico form, a style of chord progression introduced from 16th-century Italy.
 The laird o' Cockpen, he's proud an' he's great,
His mind is ta'en up wi' affairs o' the State;
He wanted a wife, his braw house to keep,
But favour wi' wooin' was fashious to seek.

Down by the dyke-side a lady did dwell,
At his table head he thocht she'd look well,
M’Leish's ae dochter o' Clavers-ha' Lea,
A penniless lass wi' a lang pedigree.

His wig was weel pouther'd and as gude as new,
His waistcoat was white, his coat it was blue;
He put on a ring, a sword, and cock'd hat,
And wha could refuse the laird wi' a' that?

He took the grey mare, and rade cannily,
And rapp'd at the yett o' Clavers-ha' Lea;
‘Gae tell Mistress Jean to come speedily ben, -
She's wanted to speak to the laird o' Cockpen.’

Mistress Jean she was makin' the elderflower wine;
‘An' what brings the laird at sic a like time?’
She put aff her apron, and on her silk goun,
Her mutch wi' red ribbons, and gaed awa' doun.

An' when she cam' ben, he bowed fu' low,
An' what was his errand he soon let her know;
Amazed was the laird when the lady said ‘Naw’,
And wi' a laigh curtsie she turned awa'.

Dumfounder'd was he, nae sigh did he gie,
He mounted his mare - he rade cannily;
An' aften he thought, as he gaed through the glen,
She's daft to refuse the laird o' Cockpen.
 Some time after Nairne's death in 1845,[disputed  – discuss] two additional stanzas were added to the song. Rogers, in his The Life and Songs of the Baroness Nairne, attributes them to the novelist Susan Ferrier, but she denied having written them and claimed that their author was Sir Alexander Boswell.
 And now that the Laird his exit had made,
Mistress Jean she reflected on what she had said;
"Oh, for ane I'll get better, its waur I'll get ten,
I was daft to refuse the Laird o' Cockpen."

Next time that the Laird and the lady were seen,
They were gaun arm-in-arm to the kirk on the green;
Now she sits in the ha' like a weel-tappit hen,
But as yet there's пае chickens appeared at Cockpen.
 
In the opinion of Carol McGuirk, professor of 18th-century British literature at Florida Atlantic University, these final two stanzas weaken the song's satirical sting, and "continue to be thought of as Nairne's own work and do no credit to her reputation".