Keates struck the only goal in the 29th minute when headed home from a Chris Whelpdale cross to beat stopper Wayne Brown.
Posh were rampant with George Boyd having a shot blocked by Trent McClenahan. Aaron Mclean also flicked a header wide and Gary Hooper had the Posh defence at full stretch before Craig Morgan dispossessed him.
Hereford responded with Clint Easton’s 30-yard free kick which goalkeeper Joe Lewis saved.
Lewis was in action again when he made a superb save to stop a shot from Steve Guinan. Posh continued to push forward with Keates heading over while Adam Newton and Craig Mackail-Smith forced good saves from Brown.
Lewis then came to Posh’s rescue when he saved a free kick from McClenahan.