The pillory was an ancient punishment and as early as the 13th century it was used for traders who had swindled the public. After 1637 it became the recognized punishment for those who published books without a license or libeled the government. Once locked into the mechanism, the prisoner would be pelted with rotten eggs, vegetables, or even excrement by members of the public.
The most famous pillory in London was at Charing Cross, located at the junction of Strand, Whitehall, and Cockspur Street, just south of Trafalgar Square. As noted in Crime, Punishment, and Reform in Europe by Mary Anne Nichols and Louis A. Knafla:
The crowd played an important role. As a form of legally sanctioned street theatre, each pillory event relied upon the audience for its success. In a carnival-like atmosphere, people crowded the streets and surrounding buildings in an attempt to get the best vantage point to view the offender’s punishment.
Definitely not your typical high-brow entertainment, nevertheless, the mobs gathered to “enjoy” the spectacle did not exclusively consist of the common folk. Those who gathered round the pillory were expected to denounce the individual and uphold the rule of law, as well as protect the moral standards of the community. Conversely, when the public disagreed with the verdict of the court they turned the event into a demonstration against those in power. For example, when Daniel Defoe was pilloried in 1703 for libel, the crowd covered the pillory in flowers and gave him an ovation when he arrived at Charing Cross.
In 1816, the pillory as a form of punishment was abolished except for certain crimes such as perjury.