The study found that between 2001 and 2010, emergency room doctors issued between 560,000 and 880,000 codeine prescriptions to kids each year.
That's even despite the fact that the American Academy of Pediatrics has warned doctors to use safer alternatives.
Experts say kids' ability to metabolize codeine varies wildly, noting that a dose that's ineffective in one child could be toxic in another.
Codeine is an opiate and a genetic variation makes some people metabolize it too quickly. The Food and Drug Administration issued its strictest warning last year about a rare risk for life-threatening complications or death in children.
Another genetic variation makes the drug ineffective for pain relief in as many as a third of patients.
(The Associated Press contributed to this report)