Willem Frederik Hertzog, member of a prominent Cape family, attended the Latin School in Cape Town and then studied modelling, drawing and mathematics under the sculptor and art teacher Anton Anreith. He joined the public service of the Cape Colony in May 1809 as a clerk in the landdrost office. However, his studies progressed so successfully that in May 1813 he was ready to be examined in surveying by Louis M. Thibault*, who found him to be competent. On the basis of Thibault's report he was sworn in as a government land surveyor. From June 1813 he worked in the Stellenbosch district and early in 1817 was asked to survey and draw up the first detailed plan of the town. This commission resulted in one of his best cartographic works, Plan van het dorp Stellenbosch, completed in August that same year. In 1823 he left for Europe for further study and for health reasons. A life-sized marble bust of him was made by J.L. Leeb in Italy in 1826. He returned to the Cape in 1828. Soon after Charles C. Michell* was appointed as the first surveyor-general at the Cape, Hertzog became the assistant surveyor-general in September 1828. With the appointment of C.D. Bell* as second assistant surveyor-general in 1840, Hertzog became first assistant surveyor-general.
In February 1844 Hertzog recommended to surveyor-general Michell that two standard rods of six Rhynland feet each, formerly used by Thibault, be accurately compared with British standards of length to establish the exact size of the Cape land unit. Such a comparison was eventually carried out in 1858 by a commission led by Thomas Maclear*. The commission found the unit to be equivalent to 1.033 British Imperial feet (314.85mm) and renamed it the Cape foot.
Hertzog had a forcefull personality, a strong interest in education, and was equally proficient in English and Dutch. In 1828 he was a member of the committee that planned the establishment of the South African College, the first educational institution of note in South Africa to provide secondary education, which opened in Cape Town on 1 October 1829. In June that year he was elected by the subscribers as a member of the institution's council, serving as joint secretary for two years. Thereafter he was a council member on and off for the next twelve years, eventually also representing council on the College senate in 1845. His other public activities included serving on the editorial board of Het Zuid-Afrikaansche Tijdschrift in 1829. From June that year he also served on the first council of the newly founded South African Institution, the first society devoted entirely to the advancement of science in southern Africa. He remained a member of council when the institution amalgamated with the South African Literary Society in 1832 to form the South African Literary and Scientific Institution. From 1834 he was a member only of the institution's statistical committee for three years. He married Susanna Cornelia Hiddingh in February 1835, and they had four children.
Hertzog was one of South Africa's early fossil collectors. He gave specimens that he had collected near Clanwilliam, and along the Bushman's and Sunday's River from the Uitenhage and later beds, to professor J.F.L. Hausmann*. These included a bivalve shell (later included in the genus Trigonia) that was named Lyrodon hertzogii by Goldfuss in 1840.
During 1833 and 1834 Hertzog surveyed plots for a Coloured community at Tamboekievlei on the Kat River. In recognition of his work there the tiny village of Hertzog (7 km south-west of Seymor) was named after him in 1844. In December 1837 he was sent to resurvey the eastern border of the Cape Colony. While his family resided in Grahamstown and then in Graaff Reinet he and three assistants conducted a large scale survey of farms in the Somerset East, Fort Beaufort, Graaff Reinet, Cradock and Grahamstown districts. His numerous maps, diagrams and sketches showed natable artistic skill and constitute important historical sources.
During his time in the Eastern Cape Hertzog experienced health problems and in February 1839 was so badly injured when he fell off his horse that for some time he could only do office work. He returned to Cape Town in 1840. In April 1846 he retired on pension and then started speculating in property, buying fifteen farms in Natal and four plots in Pietermaritzburg. He also owned eight houses in Cape Town and many shares. However, he died before he could profit from these investments.