Metonymy means referring to something by one of its attributes or by using a related word. If a reporter notes that “the White House released a statement,” that’s metonymy: “the White House” means the President or the President’s administration.
Metonymy comes from the Greek word metonymia, meaning “a change of name.” You’ve probably heard examples of metonymy, even if you didn’t know the technical name for this figure of speech. Describing a monarch as “the Crown” or businesspeople as “suits” is metonymy. The expression “the pen is mightier than the sword” uses metonymy twice: “the pen” refers to writing, while “the sword” refers to war. Don’t confuse metonymy with synecdoche, a related figure of speech in which a part is used to refer to the whole.
substituting the name of an attribute or feature for the name of the thing itself (as in `they counted heads’)