Despite clear evidence that vaccines are effective and safe, some people still choose not to get vaccinated or to vaccinate their children, which has contributed to a surge in measles cases worldwide. In the United States, there have been five measles outbreaks this year and at least 127 individual cases.

One or two in 1,000 children who contract this highly contagious disease will die. Last year, measles killed 72 adults and children in the European region, where measles has reached its highest levels in two decades. While measles deaths are rare in developed countries, the illness can have severe lasting consequences, such as vision loss.

There are several reasons for vaccine hesitancy: worries about side effects, cost, moral or religious objections, fears about a debunked link to autism and lack of knowledge about immunizations.

“We’re just seeing all sorts of misinformation flying around on social media,” said Arthur L. Caplan, head of the Division of Medical Ethics at the New York University School of Medicine, who has been writing about vaccine ethics and policy for 25 years.

“Fake news. Fake science,” he said on Friday. “Everybody’s an expert.”

Last week, Representative Adam B. Schiff of California, a Democrat and the chairman of the House Intelligence Committee, wrote a letter to Mark Zuckerberg, the chief executive of Facebook, asking what steps the company was taking to prevent anti-vaccine information from being recommended to users. He sent a similar letter to Sundar Pichai, the chief executive of Google, which owns YouTube.

YouTube said on Thursday that it started surfacing more authoritative content in late 2017 for people searching for vaccination-related topics, and that its algorithmic changes would become more accurate over time.

YouTube also said it does not permit anti-vaccine videos to show ads.

“We have strict policies that govern what videos we allow ads to appear on, and videos that promote anti-vaccination content are a violation of those policies,” a YouTube spokeswoman said on Friday. “We enforce these policies vigorously, and if we find a video that violates them we immediately take action and remove ads.”