Grubhub wants to keep an explosive lawsuit claiming it’s ripped off restaurants out of the public eye — even as it scrambles to quietly contain the fallout from irate restaurant owners.

The giant food delivery company is asking a Philadelphia federal judge to toss a lawsuit claiming that Grubhub has been charging restaurants each time diners pick up the phone — regardless of whether the calls result in a food order generated by Grubhub.

The lawsuit, filed by the owner of an Indian restaurant in Philadelphia called Tiffin, is seeking class-action status.

But the Chicago company tossed water on that prospect Friday when it told the judge that the lawsuit belongs in arbitration, where it would be handled behind closed doors.

“Plaintiffs signed written contracts in 2011 with Grubhub that incorporate online terms of use, which since 2016 have included arbitration and class waiver provisions,” Grubhub said in a court filing.

Grubhub, founded by Matt Maloney, has been under siege after thousands of restaurants learned last month — thanks to an exclusive report in The Post — that the company has been charging them up to thousands of dollars a month to answer the phone, even if it’s just for a customer asking when they’re open.

Grubhub, which also owns Seamless and Menupages.com, is supposed to only charge restaurants a percentage of orders it helps generate.

Lawyers for Tiffin shot back Monday, accusing the company of “Monday-morning quarterbacking, grasping at straws, scorching the earth, using every available resource, dozens of employees and lawyers … in a mad scramble to avoid liability for its misconduct.”

Indeed, Grubhub has gone so far as to threaten another angry restaurateur that his eateries will disappear from the company’s apps if he files suit to get back bogus charges, The Post has learned.

“If you would like to pursue legal action, you can send us a letter accordingly. Both accounts would have to be paused until the legal matter is resolved,” a Grubhub account adviser wrote to the owner, according to December emails obtained by The Post.

Angry restaurateurs say Grubhub is taking an à la carte approach to paying them back — offering them 60 to 90 days’ worth of refunds despite years of potential overcharges.

Owners who balk at these meager refunds have been offered as much as a year’s worth of returns, sources said.

Gente Ristorante Italiano owner Jay Mitchell said Grubhub pre-emptively refunded his restaurant for erroneous fees going back as far as December 2018, including one $9 fee for a missed call.

“Our statements going back to December listed ‘credit’ next to these phone orders even though we didn’t ask for that,” Mitchell said.

A Grubhub spokeswoman declined to comment.

Grubhub’s argument for sending Tiffin’s lawsuit to arbitration rests in part on the online records showing the owner clicked on and viewed the company’s terms of use before suing.

“Even if plaintiffs had not explicitly accepted the terms when first signing up, they would still be bound,” according to Grubhub.