The Addiction Research Unit from the University of Buffalo has a fascinating page on how
The prohibition of psychoactive substances has evolved gradually in the United States and in Europe. The opium-containing preparation laudanum had been widely available since the 18th century. Morphine, cocaine, and even heroin were seen as miracle cures when they were first discovered. During the mid to late 19th century, many manufacturers proudly proclaimed that their products contained cocaine or opium. A few, like Mrs. Winslow’s Soothing Syrup for infants which contained morphine, were more guarded in divulging their principal ingredients. By the beginning of the 20th century, problems with habitual use of cocaine and opiates was becoming increasingly apparent. This led to the removal of these substances from some products (e.g., Coca Cola) and to the introduction of the Pure Food and Drug Act (1906) in the United States which required the listing of ingredients on product labels. Nonetheless, standard narcotic remedies like paregoric remained readily available into the early 20th century, and Benzedrine inhalers were marketed without prescription until the early 1950s. Codeine wasn’t removed from most over-the-counter cough suppressants until the early 1980s.
Thanks to Jean-Francois for this one!