Words and phrases like these are commonly used in front of children by parents or family members when they would otherwise use a swear word. There are many such words or phrases, sometimes having been in use for generations, others more recently invented.
Alternative exclamatory phrase / question for what the fuck or what the hell, primarily the latter. Mostly useful for when a substitute swear word is necessary, like around young kids and censor-minded folks, and other such phrases, like what the fudge are considered to be too close to what they're supposed to replace.
"What the hedge was that?" or "What the the hedge was going on back there?
#what the hell#what the fuck#holy shit#what the heck#what the fudge