Stories have been told for thousands of years about bottles being used to imprison malicious spells or spirits.
Even before glass was invented, with wooden shutters rather than glass window panes keeping out the night, people sat around the fireside and heard about King Solomon trapping devils inside bottles of cured leather. One of those devils, or jinn, appears in the Arabian Nights story, “The Fisherman and the Jinni.” Angry at having had to wait so long to be released, the jinn is about to kill the fisherman, but first agrees to prove that he can fit inside the bottle - at which point the fisherman pops in the stopper, trapping him again.
Perhaps taking their cue from Solomon, Jewish sorcerers of the Middle Ages called their familiar spirits “oboth”, a word which also means a gourd or bottle.
Witch bottles from 18th century Europe usually contained the nail clippings, hair and body fluids of somebody who thought they were the victim of a witch’s curse, along with iron nails and pins that were supposed to reflect pain on the caster. The idea was that the bottle sucked in the evil magic, and possibly the witch themselves.
One of the most famous witch bottles belonged to the family of an old lady in East Sussex, who said, “They do say there be a witch in it, and if you let un out there’ll be a peck o’ trouble.”