Comedy Central writers who worked on Donald Trump‘s roast were so worried that Mike “The Situation” Sorrentino would mess up his jokes that they spelled House Speaker John Boehner‘s name phonetically on his autocue as “BAYNER” — so the “Jersey Shore” star wouldn’t say, “Boner.” But Sorrentino was so bad that he became the first roaster in more than a decade to be drowned in a tidal wave of heckles and boos.

“By the way, who’s John Boehner?” Sorrentino pronounced it correctly — but went on, “Check it out. Doesn’t his name sound like boner? Anyone notice that . . . boner?”

“Hey, Snoop Dogg,” Sorrentino sneered at the pot-smoking rapper, who openly puffed on a large blunt while onstage. “Donald Trump and your ancestors had a lot in common — they owned real estate, and your ancestors were property!” More heckles.

VIDEO: ROASTED TRUMP

PHOTOS: DONALD TRUMP ROAST

As the boos filled the Hammerstein Ballroom Wednesday night, Sorrentino whined, “This is my first time doing comedy!”

“And your last!” shouted comic Jeff Ross.

Sorrentino smelled strangely like a hot dog up close, reports The Post’s Don Kaplan — and ignored Kaplan when he asked The Sitch if he knew how to spell “bomb.”

Sorrentino inexplicably shared the dais with seasoned comics like Lisa Lampanelli, Whitney Cummings, rookie roaster Anthony Jeselnik, Marlee Matlin, and Larry King — who is so old that “the last time he covered an uprising in Egypt, Larry interviewed Moses,” joked Jeselnik.

The roastmaster, “Family Guy” creator Seth MacFarlane, spent a good part of the event, which will air as a Comedy Central special on Tuesday, blasting The Donald’s presidential aspirations. “Trump opposes abortion,” said MacFarlane, “which makes sense, because that’s his next wife he may be killing.” Trump did not laugh.

Snoop sniped, “You’re thinking of running for president? Wouldn’t be the first time you pushed a black family out of their house.”

Trump took the blows in stride.

“What’s the difference between a wet raccoon and Donald J. Trump’s hair?” the mogul joked. “A wet raccoon doesn’t have $7 billion [bleeping] dollars in the bank!”