In recent weeks, Pinterest, YouTube, Facebook, and Amazon have done something previously thought unimaginable: They’ve censored potentially dangerous health information, at last addressing a problem that started in the late 1990s.

In 1998, Andrew Wakefield, a British gastroenterologist, published a paper claiming that the combination measles-mumps-rubella (MMR) vaccine caused autism. The following year, in 1999, the U.S. Public Health Service, exercising an abundance of caution, asked pharmaceutical companies to eliminate the mercury-containing preservative, thimerosal, from most vaccines.

Many watching this one-two punch against vaccines worried about what would happen next. Such groups as Every Child by Two (now Vaccinate Your Family), the Centers for Disease Control and Prevention, the American Academy of Pediatrics, the Immunization Action Coalition, the Autism Science Foundation, Parents of Kids with Infectious Diseases, the National Meningitis Association, and Meningitis Angels, among others, created websites and distributed educational materials about the importance of vaccines. Researchers performed dozens of studies showing that MMR didn’t increase the risk of autism and that the trace quantities of mercury in vaccines weren’t harmful. Indeed, Andrew Wakefield’s paper was later retracted when he was found to have misrepresented clinical information.

Nonetheless, as feared, the controversies surrounding MMR and thimerosal created a foothold for anti-vaccine groups.

During the following 15 years, organizations like the National Vaccine Information Center (formerly Dissatisfied Parents Together), Generation Rescue, Moms Against Mercury, and Safe Minds became the one-stop shop for mainstream media outlets interested in airing parents’ concerns about vaccines.

The results were predictable.

Influenced by thousands of television shows, radio programs, and newspaper articles, a critical number of parents stopped vaccinating their children. As a consequence, measles infections, which were eliminated from the United States by 2000, came roaring back. An outbreak starting in Disneyland in 2014 spread from California to 24 other states. Now hundreds of children whose parents have chosen not to vaccinate them are infected with measles every year. Many are hospitalized. When hundreds become thousands, children again will start dying from measles.

But the tide is turning. Mainstream media, in the face of overwhelming scientific evidence supporting the safety of vaccines, realizes that there aren’t two sides to this story. Also, nothing educates like outbreaks.

Although marginalized, activists haven’t given up, turning their attention from mainstream media to social media, where their misinformation continues to cause harm. It is here that the anti-vaccine groups have thrived. Anti-vaccine blogs, websites, books, live streamings, podcasts, chat rooms, and Facebook pages dominate the landscape.

Recently, and surprisingly, social media outlets have started to push back. Pinterest now bars searches for vaccine content. YouTube no longer allows anti-vaccine groups to monetize their videos with ads. Facebook fact-checks health articles to determine which will appear less prominently in news feeds. And Amazon has started removing anti-vaccine documentaries from its video streaming service.

In response, anti-vaccine groups have cried foul, arguing that these actions represent an abridgment of their First Amendment right to free speech. The law, however, has historically set limits on that right. In 1919, Supreme Court Justice Oliver Wendell Holmes Jr., in Schenck v. United States, reasoned that free speech did not extend to “falsely shouting fire in a crowded movie theater causing a panic.” Holmes argued that to do so might cause people to be hurt or killed while running for the exits. The same is true here. By unnecessarily scaring parents, hundreds of children are getting trampled every year.

To their credit, several prominent social media sites are no longer waiting for children to die from preventable infections before silencing those doing the shouting.

Paul A. Offit, M.D., is director of the Vaccine Education Center at Children’s Hospital of Philadelphia and a professor of pediatrics at the Perelman School of Medicine at the University of Pennsylvania. He also is a member of the Inquirer’s Health Advisory Panel.