Learn English – Origin of idiom “wearing the < role > hat?”

etymologyidioms

What is the origin of the idiom "wearing the < role > hat"?

Here is an example from the post Getting things done when you wear multiple hats in PookieMD's Blog:

I wear many hats, and I suppose you do as well. I wear my small business owner hat when I run/manage my company, ExtraMD, my doctor hat when I play doctor, and my consultant hat when I head off to multiple meetings that seem to define the EHR consultant world I live in. Of course, I wear my mother hat, wife hat, Girl Scout leader hat, and the hat that seems to get worn the least–the self hat.

and another example from Jean Scheid's The Many Hats of a Project Manager:

As the owner of a small auto dealership, many of my managers wear more than one hat. My service director is also my parts director and my finance manager is also my sales manager. In the business office, my controller has an added responsibility of obtaining registrations for the vehicles we sell.

Best Answer

There's a related discussion over at The Phrase Finder:

I think it comes from a time (not long ago) when everyone wore hats, and many of those hats were specific to a given trade, official position or function. So someone who had several roles would have several hats and would wear the appropriate one for the occasion. [...] "which hat will you be wearing?" would mean "in which capacity will you be attending?"

As you can see, it's just speculation without citing any sources, so I have looked it up in the American Heritage Dictionary of Idioms, and here's what it has to say:

wear another hat Also, wear a different hat or two hats; wear more than one hat. Function in a different or more than one capacity or position, as in I'm wearing another hat today; yesterday I was a housewife, today I'm an attorney, or I wear two hats—are you asking me as a member of the city council or as a storeowner? This metaphoric expression alludes to headgear worn for different occupations. [Mid-1900s]

So it's indeed a metaphor, and a relatively young one.