The city’s Conflicts of Interest Board dealt a costly blow to Mayor de Blasio on Wednesday by ruling that his plan to raise big bucks through a legal-defense fund to cover bills growing out of investigations of his administration is against the law.

“The board has concluded that contributions to legal-defense funds are no different from gifts directly to the public servant,” wrote Chair Richard Briffault.

That means donations to a legal-defense fund are limited to a maximum $50 per person — except for family members, who can contribute as much as they want — making it unlikely the mayor could raise the hundreds of thousands of dollars he is expected to owe.

Hizzoner had earlier announced that he would seek donations from supporters to pay for hefty legal bills resulting from separate state and federal probes into his fund-raising practices.

Critics said such a fund with no limits on donations could be a magnet for people trying to curry favor with City Hall.

While not mentioning the mayor by name, the board issued the ruling after it “received requests for advice from public servants to help establish legal defense funds.”

Both the Manhattan DA and US Attorney’s offices announced earlier this month that the mayor would not be charged as a result of their investigations.

But de Blasio still faces huge legal bills because his lawyers have been working for about a year without pay to get him cleared.

City Comptroller Scott Stringer had advised the mayor to seek guidance from the board on how to structure the defense fund — but it was unclear whether de Blasio requested the ruling.

De Blasio, who hasn’t disclosed what he owes, said after the ruling he would consider legislation to change the regulations for everyone, not just himself.

“We’ll certainly engage [with the board] on that and determine what’s the right way to proceed,” he said at an event in Queens.

“A potential solution is through legislation. That’s a perfectly fair possibility [but] I’m not committing to anything.”

He repeated he was not going to ask taxpayers to foot the bill.

Dick Dadey, head of the Citizens Union good government group, called the ruling “very smart” and “another way to block the pay-to-play culture” that plagues politics.

He also said it strengthens campaign-finance ethics regulations.

“It creates a protected wall against influence peddling . . . and further limits the influence of money in politics,” Dadey said.

Taxpayers must still pay for $11.6 million in legal expenses incurred by mayoral aides who were ensnared in the investigations.