“On top of that, one of the issues with kids historically is there was no easy way to measure pain in kids,” Dr. Schechter said. If your 4-year-old was crying it might be “because he missed mommy and daddy, or he was anxious.” The real problem, he said, was that nobody knew how to dose pain control medications safely in children, because the research hadn’t been done.

Today, “nobody’s getting intramuscular injections,” said Dr. Charles Berde, the founder of the division of pain medicine at Boston Children’s Hospital. As pain management improved, at first, the focus was indeed on giving opioids — like morphine — but on giving them intravenously, and with older children at least, on having the patient actually control the dose, with devices called PCAs, for patient-controlled analgesia.

But over the last 15 years, Dr. Berde said, the focus has shifted to optimizing all the nonopioid methods of pain control. That means using regional anesthesia, like nerve blocks, using nonsteroidal anti-inflammatory drugs, like ibuprofen and its relatives, and using acetaminophen (Tylenol). Dr. Berde, who wrote a 2016 review of the different modalities for pain control, said that opioids are still important for the most painful surgeries, such as large spine operations and open chest operations, although even in these situations, most children get them for less than a week. For smaller surgical procedures, he said, they should be used as “rescue” drugs when others fail, not as the predominant agents.

“Pain medicines act on different sites in the periphery and in the central nervous system,” Dr. Berde said. “Combinations are often more effective than a single medicine.” Thus, in the first couple of days after a minor surgical procedure, a child might get round-the-clock acetaminophen and nonsteroidal anti-inflammatory medication, using opioids only as backup, very short-term for a midrange procedure.

Surgical procedures nowadays often use minimally invasive methods like laparoscopy and arthroscopy, with easier recoveries and less pain, and patients are generally encouraged to return to activity much more quickly than in the past. Procedures are often done on an ambulatory outpatient basis, which puts responsibility for pain management on the parents when they take their child home. “Ideally, you want to have your kid in a hospital where they make it a priority to have systems in place,” Dr. Berde said. Parents need clear guidance, and they should know whom they can call with questions and problems.

“Kids benefit from a very individualized tailored approach,” Dr. Berde said, “from being honest with them about when there is discomfort and giving them ways to get through it, ways to feel like there is some mastery.” A child’s pain control should be tailored not only to the particular surgery, he said, but also to past experiences with pain, and even to the individual biology of the child. “There are clear biological differences between people in how much medicine they need and how well it works for them,” he said, and in the near future, it may be possible to predict these differences and tailor individual pain regimens.

Parents should be vigilant that their children are in fact receiving adequate pain management. “Parents assume everything possible is already being done for their child when we know in fact many of the evidence-based solutions for acute or procedural pain many times are not used in practice,” said Christine Chambers, a professor and children’s pain researcher at Dalhousie University in Halifax, Nova Scotia. “Pain still isn’t given the priority that it deserves.”