Everyone knows that Twitter is a sewer. It’s also a terrible newspaper editor and a lousy campaign manager.

Paul Begala knows something about the last of those. Begala has had his highs and lows as a campaign strategist — he once lost a student-government election at the University of Texas to an imaginary cartoon figure called Hank the Hallucination, but he went on to lead Bill Clinton’s presidential campaign in 1992, so he’s got that going for him — and he worries that Twitter is pushing Democratic candidates far to the left of where the party is.

He complains that the Democrats’ social-media universe is dominated by “over-caffeinated, over-opinionated, pain-in-the-ass white liberals.” (Hello, Brooklyn!) The problem? “Every candidate, and every staffer, checks Twitter and other social media scores of times a day,” he told the columnist Thomas B. Edsall.

The loudest voices on progressive Twitter are affluent, college-educated whites in a handful of expensive coastal neighborhoods. The median Democratic voter is less wealthy, less likely to be white and less militant. “Militant” used to call to mind images of Black Panthers or union radicals. Now, it’s Caitlyn, an MFA candidate at Oberlin. That’s a small constituency.

The Twitterfied Democrats consequently are having a little trouble with coalition-building. Zealots on the platform beat poor Mario Lopez into craven submission for suggesting that it might be premature to discuss sex-change operations with 3-year-olds, who may very well still believe in the Easter Bunny. (Spoiler.) He’s woke now, but he should have seen it coming: Leana Wen was a longtime Democratic foot soldier and abortion-rights advocate when she became the head of Planned Parenthood — but got canceled on Twitter and was immediately canned for being insufficiently enthusiastic about new pronoun conventions and the concept of “men who become pregnant.”

You ain’t never woke enough for Twitter.

Ask Robert Francis O’Rourke, the model progressive who took a beating on social media for joking about his wife staying home to raise the kids. Ask Bill de Blasio, who when he isn’t trudging around Iowa cornfields is on Twitter showcasing such priorities as ensuring that “every trans and nonbinary New Yorker” enjoys the “right to have your identity affirmed on your New York City birth certificate.” Ask Kirsten Gillibrand, who “as a white woman of privilege” has decided to lecture “white women in the suburbs” on “what white privilege actually is” via Twitter, of course.

Or ask The New York Times.

After the El Paso massacre, the Times published a headline reading: “Trump urges unity vs. racism.” The headline was entirely accurate and appropriate, but it wasn’t woke, and wokeness is a jealous god. After a Twitter-led two-minute hate campaign, the paper knuckled under and changed the headline to “Assailing hate but not guns.”

That’s Twitter politics in a nutshell: Ignore the facts, change the subject and assume the self-evident moral unassailability of whatever it is you are feeling right this second.

Twitter is both a platform for mass-hysteria woke politics and a perpetrator of them. When a rabble of angry activists stood on Sen. Mitch McConnell’s front lawn baying for his blood, the Senate majority leader tweeted out video of the sorry episode. Twitter suspended his account. The people calling for his murder went about their business without interference.

‘That’s Twitter politics in a nutshell: Ignore the facts, change the subject and assume the self-evident moral unassailability of whatever it is you are feeling right this second’

Now, that’s woke.

The Democrats who mistake social media for the real world should read some of the five decades’ worth of research on “group polarization,” the tendency of ideological echo chambers to breed extremism. Social media rewards hysteria and theatricality. That’s why Donald Trump is good at it.

Which means that the Democrats risk missing a layup in 2020. All they really have to do is field a candidate who can credibly promise to govern more responsibly and with more dignity than Donald Trump. What they’re going to get is someone who insists that anybody harboring doubt about the idea of “men who get pregnant” is the moral equivalent of Adolf Hitler.

Twitter isn’t real life. Democrats can learn that the smart way or the hard way.

Kevin D. Williamson is the author of “The Smallest Minority: Independent Thinking in the Age of Mob Politics” (Gateway Editions), out now.