Talk through one's hat
Talk nonsense; especially on a subject that one professes to be knowledgeable about but in fact is ignorant of.
This began life in the USA, in the late 19th century, with a slightly different meaning from the present one. It then meant to bluster. Farmer and Henley Slang and Its Analogues, 1888:
"Dis is only a bluff dey're makin' - see! Dey're talkin' tru dere hats"
It would be nice to be able to report that this graphic phrase alludes to some event where someone used a hat to disguise their speech, or similar. The only practice that comes close to fitting the bill is that of 'topping', in the UK parliament. To be allowed to make a 'a point of order', which is an interruption to a previous speech in order to query something that had been raised, MPs had to be 'seated and covered'. That is, seated and wearing a hat. Topping was the name given to 'talking out' a bill, otherwise known as filibustering, by continuing to speak until debating time ran out. Having made a point of order and while wearing a top hat, an MP couldn't be interrupted and could continue talking for as long as he/she wished. Naturally, as these speeches often lasted hours, they were frequently filled with rambling nonsense.
Unfortunately, although the link is plausible, I can't find any documentary evidence that links this practice with talking through one's hat. It also seems unlikely that the arcane practices of top-hatted Victorian gentlemen in the UK parliament would have crossed the Atlantic. Much more likely that the phrase originated in the USA and the meaning changed slightly over time.
See other phrases that were coined in the USA.