Pie or cake, cake or pie. It's a tough choice, even when you're telling someone to hush up. Both "Shut your pie hole!" and "Shut your cake hole!" trip off the tongue in a satisfying fashion, with "pie" having the slight edge for me because it's easier to aspirate the "h" in hole after saying pie than it is after saying "cake".
(BTW, I've seen it written pie hole, pie-hole and piehole, so I'll use it interchangeably in this short essay so as to drive everyone nuts.)
So, where does this term come from? According to internet research, the easiest and least reliable kind, "cake hole" came first and was coined in the 40's by British airmen (http://www.phrases.org.uk/meanings/320050.html). It was used most until about 1970. The earliest textual reference to pie-hole, on the other hand, occurred in the 1980's (http://www.word-detective.com/2007/07/31/pie-hole/) although Merriam-Webster online has the piehole entry dated 1993 (http://mw1.merriam-webster.com/dictionary/piehole).
If you search IMDB, characters have been told to shut their pie holes on Frasier, Space Ghost Coast to Coast, Degrassi: The Next Generation, The Riches, Supernatural, Titus, Anger Management, The Angry Beavers, Christine, Dead Rising (movie) and GingerDead Man. All 80's or later. People were told to shut their cake holes in Are You Being Served? (70s) and, again, Supernatural. (Dean Winchester obviously enjoys both pie AND cake.) And those are just the quotes that came up with IMDB's quote search engine, which certainly isn't the entire script. I'm sure it showed up a lot in movies from the 40's-70's but those movies aren't as well known to IMDB audiences.
Apparantly piehole can also be a verb that means curtailing opposing viewpoints on loops or blogs: http://www.urbandictionary.com/define.php?term=piehole
Why did those British servicemen choose cake (and later we Americans add pie) instead of any of the other foods in the world one could shove into one's mouth? I would presume it's because pies and cakes are round like an open mouth. They are also sweet and fattening, implying the person you're shushing not only blabs too much but makes poor dietary choices.
And besides. Do you really want to tell people to shut their vegetable hole?
In the nicest possible way, here's my question for visitors -- what new "hole", used in the "shut your" sense, might be fun to add to the slang dictionaries of tomorrow?