Where does the word “Claptrap” come from and What does Claptrap mean?

The definition of the word “Claptrap” which appeared in Nathan Bailey’s dictionary of 1720 tells the full story:

“A Clap Trap, a name given to the rant and rhimes that dramatick poets, to please the actors, let them go off with: as much as to say, a trap to catch a clap, by way of applause from the spectators at a play.”