The quietest Democratic presidential candidate in last week’s debates walloped the rest of the field in the Twitter primary.

Andrew Yang spoke only four times during Thursday night’s contest — and never once butted in.

But the little-known tech entrepreneur racked up more than 108,000 new Twitter followers in the hours that followed, according to a Post analysis, almost 38,000 more than his runner-up in total new followers, Sen. Kamala Harris of California.

The Iowa caucuses, the first votes that count in the 2020 presidential election, are still a grueling 217 days away. But the Twitter primary — the relative social-media popularity of the Democrats’ 25 candidates — is happening minute by minute.

Yang, who had 337,000 fans on the platform on June 25, boosted that total more than 32% the day after his first appearance before a national audience.

Harris, widely considered to be the evening’s winner, gained close to 70,000 followers over the same time frame. But as a top-tier candidate who had cultivated a substantial social media presence, that added only 2.6% to her base of 2.7 million fans.

Coming in third was Julian Castro, whose Spanish-language pro-immigrant appeals helped him add 55,000 new devotees — a 25% increase for the former Obama cabinet secretary.

“The buzz you can create from social media like Twitter can have a real effect,” Democratic strategist Bruce Gyory told The Post. “That’s the kind of early energy Barack Obama had in 2008 and Bernie Sanders had in 2016 that helped them do better in the primaries.”

Sanders, the Democratic Socialist senator from Vermont, has held on to the huge Twitter fan base he built in that contest, with far more followers — 9.3 million — than anyone else in the field.

But his Thursday night debate performance won him fewer than 19,000 new ones, suggesting that his appeal may have reached peaked.

The floundering campaigns of New York Sen. Kirsten Gillibrand and Mayor Bill de Blasio also failed to gain social-media traction.

“It’s a good way to measure the buzz about the candidates — and to identify the no-hopers who should maybe not be in the race at all,” said blogger Lawrence Person, who has been tracking the candidates’ Twitter numbers since March on his BattleSwarm site. “Up to now the numbers have been pretty stagnant, with a few exceptions, like Mayor Pete Buttigieg.”

“It’s like the flash, splash, color and movement of an old-fashioned battlefield cavalry charge,” Gyory said. “But victory will be determined by who can produce a land army with foot soldiers.”

“Unless you back that cavalry charge with ground troops in the early primary states, it won’t help you.”