Papa John’s is snapping out of its baseball slump.

More than a half-dozen MLB teams that broke ties with the embattled pizza chain have quietly restored their partnerships, which usually include free or discounted pies, The Post has learned.

Some 20 sports leagues, universities and teams dropped Papa John’s last month after its founder and former chief executive, John Schnatter, admitted to using the n-word during a conference call in May and publicly apologized for it.

The New York Yankees made the move last week to show support for some 120 local franchisees in the tri-state area who had nothing to do with Schnatter’s controversial remarks, the team said.

“We feel strongly that this incident does not represent their principles, values or their responsibilities to the communities they serve,” the Bronx Bombers said in a Friday statement, in which the team also praised the Louisville, Ky.-based franchisor for taking “measures to restore customers’ faith in their brand.”

Last week, the company said it is reducing some of the fees franchisees pay to help them deal with declining sales since the controversy erupted in July.

Investors cheered the move, sending shares of Papa John’s up by 3.9 percent, to $41.81, on Monday.

On Sunday, the Baltimore Orioles became the seventh known Major League Baseball team to begin offering Papa John’s promotions again.

The Tampa Bay Rays were likely the first to do so on July 18 after the chain began removing images of Schnatter from its marketing materials and stores. Others that have done so since include the Washington Nationals, Pittsburgh Pirates, Minnesota Twins and Texas Rangers.

There are others that are considering reinstatement as well, a spokesman for Papa John’s told The Post.

MLB may also reinstate its “Papa Slam” promotion, said a source with knowledge of the situation.

“It’s the start of the brand rebounding,” said Deb Gabor, CEO of Sol Marketing, a brand strategy consultancy in Austin, Texas. “But what they really have going against them is this fighting back and forth between Schnatter and the corporation. While these guys continue to throw each other under the bus, it’ll be hard to repair the brand.”