William Hamilton MacFarland (February 9, 1799 - January 10, 1872) was a Virginia politician. He was born in Lunenburg County, Virginia and later served in the House of Burgesses from 1822 to 1824 and from 1830 to 1831. He was elected to the Provisional Confederate Congress and served from 1861 to 1862.