O King of kings, Thy blessing shed. [National Hymn.] This hymn "For the King" appeared anonymously in the 8th edition of Cotterill's Selection, 1819, No. 266, in 5 stanzas of 4 lines. It is known in the following forms:—
1. Its full form as above, and in various hymnbooks to 1837.
2. In 4 stanzas of 4 lines in Bickersteth's Christian Psalmody, 1833. This is the text, with the necessary changes from King to Queen, &c, which was used in the S. P. C. K. Jubilee Hymns, 1887, and other Jubilee collections.
3. The same arrangement of stanzas altered to suit the changed circumstances occasioned by the accession of H. M. Gracious Majesty Queen Victoria. This was given in an early edition of Hall's Mitre Hymn Book (1st edition, 1836), and was made by Hall.
4. The Mitre Hymn Book text with the addition of Bishop Ken's doxology, "Praise God from Whom," &c.
5. The Mitre Hymn Book text, with a return in some instances to the original text on the one hand, and some new changes on the other, in Thring's Collection, 1882.
This hymn is usually attributed to T. Cotterill. In the Julian and the Brooke marked copies of his Selection it is blank, Snepp, in his Songs of Grace & Glory, 1872, and others attribute it to "T. Cotterill” Their authority was the simple guess of D. Sedgwick, as his manuscript testify. So far as we can discover it is "Anon. in Cotterill's Selection, 1819."
--John Julian, Dictionary of Hymnology (1907)