For years the Food and Drug Administration has been trying to get doctors to quit prescribing codeine, an opioid painkiller, to children after getting their tonsils or adenoids out.

But it can be hard to get clinicians to change their prescribing habits, even when children have died and other less risky medications are available.

In 2013, the FDA told providers that “codeine should not be used for pain in children following these procedures.” But in December 2015, nearly three years later, 5 percent of children were being prescribed the drug after surgery, according to a study published Thursday in Pediatrics.

Some children are “ultra-metabolizers” of codeine, causing their blood levels of medication to rise rapidly. That can depress breathing and be deadly.

It’s hard to know how an individual metabolizes codeine, says Dr. Kao-Ping Chua, the paper’s lead author and assistant professor in the University of Michigan department of pediatrics and communicable diseases.

“You’re rolling the dice when you prescribe codeine,” he says. “Codeine in general for children ought to be a zero event.”

In April, the FDA issued another warning saying that codeine and tramadol, another opioid pain medication, should not be used at all in children younger than 12, nor by women who are breastfeeding. That includes cough syrups and other medicines that contain codeine, such as Tylenol 3.

In medicine, sometimes you have to accept there are risks with certain drugs, Chua says. But in this case, there are safer alternatives, like Tylenol and ibuprofen. Over-the-counter agents like that have been proven to be quite useful in managing pain after tonsillectomies and adenoidectomies,” he says. “And they have a much better safety profile.”

The take home for parents, Chua says, “has to be that the best option is to try to manage a child’s pain with over-the-counter agents, like Tylenol and ibuprofen.