The words were written by Thomas Bracken in the 1870s .
`` God Defend New Zealand '' was written as a poem in the 1870s by Irish-born , Victorian-raised immigrant Thomas Bracken of Dunedin .