Masked gunmen burst into Sandal Post Office.
The two men, armed with a shotgun, threatened a female member of staff, who was behind the counter, after going into the Barnsley Road store at about 5.30pm on Monday.
But another member of staff, working in a different part of the shop managed to activate the alarm.
Both intruders then ran from the store.
Detectives hunting the gunmen say they sped off in a silver coloured vehicle, possibly an estate car.
The vehicle was parked nearby on Sandal Avenue and the men drove at high speed along Castle Road.
Det sgt Pete Whittam, from Wakefield District CID, said: “There are a number of residential properties in the immediate area and given the time of day there may well have been people arriving home from work.
“I would like to hear from anyone who saw a silver or similar coloured vehicle driving at speed or any witnesses that saw anything that may assist the investigation.
“Fortunately no-one was injured in the attempted robbery but the victims were left shaken by the incident.”
Contact Wakefield CID on 101 and quote the crime reference number 13140466808.