Thanks arthurk
The only other info I have on his family is, Parents were Benjamin Hannam and Ann Pidle married 11th Oct 1743 London Middlesex (Clandestine). They had about 8 children born between 1747 and 1802 including either 2 or 3 Williams
Still puzzling with this, but in the meantime, even if Benjamin was fathering children until 1802, they couldn't all have been with the same wife.
As others have pointed out, there are Hannams in the Retford/Mattersey area, but that's Nottinghamshire (although it was then in the Diocese of York). I'm not convinced by Greenhill on the edge of Sheffield, as that was in Derbyshire until 1934 (according to Wikipedia).
I haven't had any success in finding Richard, other than a possible probate for one in Retford in 1838 (burial transcript has him as Esqr). But I wonder - did William's father leave a will, and could that have any clues about the mystery place?
Incidentally, in William's will I notice that his brother has the surname spelt HANNAN. There's also a good friend William Hannam whom he makes executor.