SAN FRANCISCO — In 2011, President Barack Obama swept into Silicon Valley and yukked it up with Mark Zuckerberg, Facebook's founder. The occasion was a town hall with the social network's employees that covered the burning issues of the day: taxes, health care, the promise of technology to solve the nation's problems.

More than a decade later, Obama is making another trip to Silicon Valley, this time with a grimmer message about the threat that the tech giants have created to the nation itself.

In private meetings and public appearances over the past year, the former president has waded deeply into the public fray over misinformation and disinformation, warning that the scourge of falsehoods online has eroded the foundations of democracy at home and abroad.

In a speech at Stanford University on Thursday, he is expected to add his voice to demands for rules to rein in the flood of lies polluting public discourse.

The urgency of the crisis — the internet's "demand for crazy," as he put it recently — has already pushed him further than he was ever prepared to go as president to take on social media.

"I think it is reasonable for us as a society to have a debate and then put in place a combination of regulatory measures and industry norms that leave intact the opportunity for these platforms to make money but say to them that there's certain practices you engage in that we don't think are good for society," Obama said at a conference on disinformation this month organized by the University of Chicago and The Atlantic.

Obama's campaign — the timing of which stemmed not from a single cause, people close to him said, but a broad concern about the damage to democracy's foundations — comes in the middle of a fierce but inconclusive debate over how best to restore trust online.

In Washington, lawmakers are so sharply divided that any legislative compromise seems out of reach. Democrats criticize giants like Facebook, which has been renamed Meta, and Twitter for failing to rid their sites of harmful content. President Joe Biden, too, has lashed out at the platforms that allowed falsehoods about coronavirus vaccines to spread, saying last year that "they're killing people."

Republicans, for their part, accuse the companies of suppressing free speech by censoring conservative voices — above all former President Donald Trump, who was barred from Facebook and Twitter after the riot on Capitol Hill on Jan. 6, 2021. With so little agreement about the problem, there is even less about a solution.

Whether Obama's advocacy can sway the debate remains to be seen. While he has not sought to endorse a single solution or particular piece of legislation, he nonetheless hopes to appeal across the political spectrum for common ground.

"You've got to think about how things are going to be consumed through different partisan filtering but still make your true, authentic, best case about how you see the world and what the stakes are and why," said Jason Goldman, a former Twitter, Blogger and Medium executive who was the White House's first chief digital officer under Obama and continues to advise him.

"There's a potential reason to believe that a good path exists out of some of the messes that we're in," he added.

As an apostle of the dangers of disinformation, Obama might be an imperfect messenger. He was the first presidential candidate to ride the power of social media into office in 2008 but then, as president, did little to intervene when its darker side — propagating falsehoods, extremism, racism and violence — became apparent at home and abroad.

"I saw it sort of unfold — and that is the degree to which information, disinformation, misinformation was being weaponized," Obama said in Chicago, expressing something close to regret. "I think I underestimated the degree to which democracies were as vulnerable to it as they were, including ours."

Obama, those close to him said, became fixated by disinformation after leaving office. He rehashed, as many others have, whether he had done enough to counter the information campaign ordered by Russian President Vladimir Putin to tilt the 2016 election against Hillary Rodham Clinton.

He began meeting with executives, activists and other experts in earnest last year after Trump refused to recognize the results of the 2020 election, making unfounded claims of widespread voter fraud, those who have consulted with Obama said.

In his musings on the matter, Obama has not claimed to have discovered a silver bullet that has eluded others who have studied the issue. By coming forward more publicly, however, he hopes to highlight the values for corporate conduct around which consensus could form.

"This can be an effective nudge to a lot of the thinking that is already taking place," said Ben Rhodes, a former deputy national security adviser. "Every day brings more proof of why this matters."

The location of Thursday's speech, Stanford's Cyber Policy Center, was intentional, bringing Obama to the heart of the industry that in many ways shaped his presidency.

In his 2008 presidential campaign, he went from being an underdog candidate to an online sensation with his embrace of social media as a tool to target voters and to solicit donations. He became an industry favorite; his digital campaign was led by a Facebook co-founder, Chris Hughes, and several other tech CEOs endorsed him, including Eric Schmidt of Google.

During his administration, Obama extolled the promise of tech companies to strengthen the economy with higher-skilled jobs and to propel democracy movements abroad. He lured tech employees like Goldman to join his administration and filled his campaign coffers with fundraisers at the Bay Area homes of supporters like Sheryl Sandberg, chief operating officer of Meta, and Marc Benioff, CEO of Salesforce.

It was a period of mutual admiration and little government oversight of the tech industry. Although Obama endorsed privacy regulations, not a single piece of legislation to control the tech companies passed during his tenure, even as they became economic behemoths that touch virtually every aspect of life.

Looking back at his administration's approach, Obama has said he would not pinpoint any one action or piece of legislation that he might have handled differently. In hindsight, though, he understands now how optimism about online technologies, including social media, outweighed caution, according to Rhodes.

"He'll certainly acknowledge that there's things that could have been done differently or ways we were all thinking about the tools and technologies that turned out at times to see the opportunities more than the risks," he said.

Obama's views began to change with Russia's flood of propaganda on social media sites like Facebook, Twitter and YouTube to stir confusion and chaos in the 2016 presidential election. Days after that election, Obama took Zuckerberg aside at a meeting of world leaders in Lima, Peru, to warn that he needed to take the problem more seriously.

Once he left office, Obama was noticeably absent for much of the public conversation around disinformation.

"As a general matter, there was an awareness that anything he said about certain issues was just going to ricochet around the fun house mirrors," Rhodes said.

Obama's approach to the issue has been characteristically deliberative. He has consulted the CEOs of Apple, Alphabet and others. Through the Obama Foundation in Chicago, he has also met often with the scholars the foundation has trained; they recounted their own experiences with disinformation in a variety of fields around the world.

From those deliberations, potential solutions have begun taking shape, a theme he plans to outline broadly Thursday. While Obama maintains that he remains "close to a First Amendment absolutist," he has focused on the need for greater transparency and regulatory oversight of online discourse — and the ways companies have profited from manipulating audiences through their proprietary algorithms.

In Congress, lawmakers have already proposed the creation of a regulatory agency dedicated to overseeing internet companies. Others have proposed stripping tech companies of a legal shield that protects them from liability.

No proposals have advanced, though, even as the European Union has moved forward, putting into law some of the practices still merely bandied about in Washington. The bloc is expected to move as soon as Friday on new regulations to impose audits of algorithmic amplification.

Kyle Plotkin, a Republican strategist and former chief of staff to Sen. Josh Hawley, R-Mo., said Obama "can be a polarizing figure" and could inflame, not calm, the debate over disinformation.

"Adoring fans will be very happy with him weighing in, but others won't," he said. "I don't think he will move the ball forward. If anything, he moves the ball backward."

This article originally appeared in The New York Times.