 He married Louise Robinson Booker McElroy (1874–1942) on May 21, 1900; they had two daughters, Katharine Louise McElroy Kent (1902–1986), and Elizabeth Hunt McElroy (1901–1965).In 1898–1916 McElroy was a professor of history at Princeton University.An adamant opponent of "provincial thinking", he was well regarded by historians in the United States and Great Britain, and in 1912 he succeeded Woodrow Wilson as the chair of the Princeton department of history and politics.