On taking possession of his farm of Altrive Lake, which extended to about seventy acres, Hogg built a small cottage on the place, in which he received his aged father, his mother having been previously called to her rest. In the stocking of the farm, he received very considerable assistance from the profits of a guinea edition of "The Queen's Wake," of which the subscribers' list was zealously promoted by Sir Walter Scott. At Altrive he continued literary composition with unabated ardour. In 1817, he published "The Brownie of Bodsbeck," a tale of the period of the Covenant, which attained a considerable measure of popularity. In 1819, he gave to the world the first volume of his "Jacobite Relics," the second volume not appearing till 1821. This work, which bears evidence of extensive labour and research, was favourably received; the notes are lengthy and copious, and many of the pieces, which are set to music, have long been popular. His "Winter Evening Tales" appeared in 1820: several of them were composed on the hills in early life.
The worldly circumstances of the Shepherd now were such as rendered him abundantly justifiable in entering into the married state. On the 28th April 1820, he espoused Miss Margaret Phillips, the youngest daughter of Mr Phillips, late of Longbridgemoor, in Annandale. By this union he became brother-in-law of his friend Mr James Gray, whose first wife was a sister of Mrs Hogg. At the period of his marriage, from the profits of his writings and his wife's dowry, he was master of nearly a thousand pounds and a well-stocked farm; and increasing annual gains by his writings, seemed to augur future independence. But the Shepherd, not perceiving that literature was his forte, resolved to embark further in farming speculations; he took in lease the extensive farm of Mount Benger, adjoining Altrive Lake, expending his entire capital in the stocking. The adventure proved almost ruinous.
The coronation of George IV. was fixed to take place on the 19th of July 1821; and Sir Walter Scott having resolved to be among the spectators, invited the Shepherd to accompany him to London on the occasion. Through Lord Sidmouth, the Secretary of State, he had procured accommodation for Hogg at the pageant, which his lordship had granted, with the additional favour of inviting both of them to dinner, to meet the Duke of York on the following day. The Shepherd had, however, begun to feel more enthusiastic as a farmer than a poet, and preferred to attend the sheep-market at St Boswells. For this seeming lack of loyalty, he afterwards made ample compensation; he celebrated the King's visit to Scotland, in August 1822, in "a Masque or Drama," which was published in a separate form. A copy of this production being laid before the King by Sir Walter Scott, Sir Robert Peel, then Secretary of State, received his Majesty's gracious command suitably to acknowledge it. In his official communication, Sir Robert thanked the Shepherd, in the King's name, "for the gratifying proof of his genius and loyalty." It had been Scott's desire to obtain a Civil List pension for the Shepherd, to aid him in his struggles at Mount Benger; and it was with something like hope that he informed him that Sir Robert Peel had expressed himself pleased with his writings. But the pension was never obtained.