President Trump lashed out at social media “censorship” and “bias” Thursday and threatened legislation if Silicon Valley doesn’t change its ways.

“I am directing my administration to explore all regulatory and legislation solutions to protect free speech and the free speech rights of all Americans — that’s you people in this room,” he said at a “social media summit” at the White House.

“We hope to see transparency, more accountability and more freedom — that’s on both sides,” he continued.

Trump invited a host of right-wing media and online personalities to the summit, including Turning Point USA’s Charlie Kirk, Fox News’ Diamond and Silk, Project Veritas founder James O’Keefe and Lila Rose, the founder of anti-abortion organization Live Action.

Representatives from Facebook, Google and Twitter were not invited.

The president accused them of having an anti-conservative prejudice.

“We have terrible bias. We have censorship like no one has any understanding, nobody can believe,” he said. “They’re playing with a lot of minds and they’re playing unfairly.”

But he called the invitees “online journalists and influencers” and said they are “challenging the media gatekeepers and corporate censors to bring the truth to the American people.”

Trump, who has 61.9 million followers on Twitter, touted the summit on the messaging site earlier Thursday, saying a “big subject” will be the “tremendous dishonesty, bias, discrimination and suppression practiced by certain companies.”

“The Fake News is not as important, or as powerful, as Social Media. They have lost tremendous credibility since that day in November, 2016, that I came down the escalator with the person who was to become your future First Lady,” he said in one of several tweets.

The president suggested that the tech companies are putting the brakes on his and other conservatives’ social media feeds.

Democrats panned the “social media summit” saying they haven’t seen evidence that ­conservative voices are being ­silenced.

“If someone wants to show me some empirical data, instead of some alt-right member’s paranoid claims, I’d appreciate it. In the meantime, it would be great if President Trump would get serious about antitrust,” Rep. David Cicilline of Rhode Island, who is investigating the conduct of tech companies, said in a statement.

In a light moment, Trump remarked about his critics who call him out for misspellings in his tweets.

“I’m actually a good speller, but the fingers aren’t as fast as the brain,” he said.