for East Somerset, he was returned unopposed at all elections bar one. He voluntarily retired his seat in 1865 and it was subsequently held from 1878 by Sir William's son, Sir Philip Miles. He served a total of 35 years 7 months and 30 days, making him one of the longest serving MPs in the UK's parliament. Sir William was a staunch Conservative, opposed to the Reform Act, and was a protectionist who favoured the Corn Law and supported the Duke of Richmond's Central Agricultural Protection Society (known as the "Anti-League"). Miles's sympathies lay with the landowning interest in the Party. He supported the protectionist Benjamin Disraeli's early career, and was described in The Athenaeum as "chiefly responsible for his [Disraeli's] appointment". The two shared extensive correspondence and visited each other's houses over many years. It was his actions as a leader of the protectionist faction of the Conservative Party in parliament and support for Lord Derby's Prime Ministership that saw him elevated to the Baronetage. He supported amendments to the Poor Law to ensure that the responsibility for a bastard was not left solely upon the mother, as originally proposed, but would "place some portion of the responsibility on the head of the father". Miles supported Enclosure, maintaining that "Allotments of land under enclosures were much more beneficial to the poor than a common right of pasture. Not one inhabitant in ten of a parish made use of a common for purposes of pasturage; but when Allotments were made, every inhabitant participated in the benefit." He was deeply religious, at one stage putting forward an amendment in Parliament to prevent trains running on the then newly proposed Great Western Railway on Sundays. Other roles Sir William was chairman of Somerset Quarter Sessions for 35 years, partner in the family's bank, Miles & Co (which later became part of NatWest), from 1845 to his death in 1878, and commanded the North Somerset Yeomanry Cavalry as its Colonel. When the parish church at Abbots Leigh burned down in 1847, he paid for its rebuilding from his own pocket.This afternoon while the bells were chiming for divine service, a fire broke out in the rafters of the roof on the north side of the Church, it was ascertained the next day that the fire was caused by a crack in the chimney of the Store which was most negligently & stupidly built