New York City Mayor Bill de Blasio on Thursday signed 29 bills, including legislation aimed at curbing the kind of maneuvers by his own inner circle that have prompted local, state and federal investigations of the team.

Included in the legislation de Blasio signed are limits on contributions, by donors with business before the city, to elected officials’ political nonprofits — ostensibly aimed at a group like the mayor’s now-defunct Campaign for One New York.

In remarks at a public hearing on the bills, Dick Dadey, executive director of the good-government group citizens union, lamented “an emerging pay-to-play culture that we were concerned about.”

“I know you, Mr. Mayor, well enough to know that this was not your intent — but this was the unfortunate consequence of some of the activity that went on,” Dadey said of de Blasio’s nonprofit.

The bill, Introduction 1345, mandates disclosure about donors — currently there is no such requirement — and bans donations higher than $400 per year to the nonprofits under certain circumstances.

De Blasio’s Campaign for One New York — which accepted virtually unlimited donations from entities with city business — is the subject of probes by grand jurors who could indict members of the de Blasio team, The New York Times reported last week.

De Blasio has said neither he nor his team violated any law, followed legal guidance and that the nonprofit was needed to counter powerful forces aligned against his liberal agenda.

Prior to the bill signed Thursday becoming law, such nonprofits fell outside of the city’s campaign-finance laws, some of the strictest in the nation.

“This law that you are signing today is going to keep New York City first in class in campaign-finance reform and a model for the rest of the country,” Councilman Brad Lander (D-Brooklyn) said at a public hearing about the bills.

Other ethics legislation signed Thursday eliminates public matching funds for contributions bundled by people doing business with the city, limits amounts donated for transition and inauguration activities and changes eligibility requirements for certain activities like debates.

Also signed Thursday: a bill regulating the removal of deed restrictions, prompted by the administration’s mishandling of Rivington House, a former AIDS hospice on the Lower East Side that is being flipped into luxury condos for a profit to the developer. The transaction involved the mayor’s onetime top fundraiser, lobbyist James Capalino, and has been the subject of probes by multiple agencies.

De Blasio also signed laws related to inmates’ rights, developers’ promises and computer science education.

“I thought I was gonna be doing this for the rest of my life,” de Blasio joked after signing two dozen bills, some with multiple pens for each segment of his name, so every backer could get a souvenir. “That was exhausting legislating.” He had five more to go at the ceremony.