Michael Avenatti did a rare favor for President Donald Trump on Wednesday.

The attorney for porn star Stormy Daniels appeared in court in California to settle an IRS bill and answer a subpoena from a former employee who claims Avenatti owes him millions of dollars.

But Avenatti, who constantly demands that Trump reveal everything about his private financial and personal dealings from more than a decade ago, convinced the court to bar the media from the proceedings, and is trying to have the transcript sealed.

Avenatti explained to CNN — his go-to network: “I’m all for freedom of the press and open access. But everything has its limits. My personal financial dealings and that of an old law firm are of no relevance and, you know, were not going to be leveraged by other people who are trying to get famous and take advantage of the situation.”

How ironic: the man who made himself ubiquitous on cable news by leveraging Trump’s “personal financial dealings” with his client suddenly wants the news media to be silenced.

Here is a more constructive idea: Avenatti, who is constantly predicting that Trump will be forced to resign before the end of his first term, should start applying the same rules to Trump that he applies to himself.

Rule Number One: The past is the past, and things that happened long ago should not matter anymore. Rule Number Two: “Personal financial dealings,” if legal, are of “no relevance.” Rule Number Three: People “who are trying to get famous and take advantage of the situation” should be ignored.

Does that sound fair?

Also this week, Avenatti revealed that Stormy Daniels and her husband had decided to divorce. In his tweet announcing the news, he noted: “She kindly asks for privacy for the sake of her family.”

This, after she and Avenatti did their best for months to destroy the privacy of the president and his family.

Avenatti — who denounced “personal attacks” against him when Fox News exposed abuse allegations in his own ongoing divorce earlier this year — can therefore add another rule.

Rule Number Four: Respect the privacy of others.

Those rules, taken together, would seem to preclude much of what Avenatti is trying to do to force President Trump to resign. And they would thwart efforts by Democrats to impeach Trump for purely political reasons. But fair is fair, and rules are rules.

Unfortunately, Republicans this week unwittingly offered a new rule of their own when they filed articles of impeachment against Deputy Attorney General Rod Rosenstein.

The resolution claims Rosenstein committed “high crimes and misdemeanors,” but these turn out to be little more than complaints — albeit serious ones — that he is doing his job poorly.

The Republican lawmakers who want to impeach Rosenstein are correct that he ought to recuse himself from overseeing the Special Counsel investigation into Trump, since he is also a potential witness, having written the memo recommending former FBI director James Comey be fired. They are right to point out the abuses in the FISA warrant application that Rosenstein approved, and they are right to be angry that he appears to have withheld key documents from Congress.

But they could hold him contempt of Congress, or refer him for prosecution.

Instead, by making the case for impeachment — even if the resolution is withdrawn — without Rosenstein being convicted of any “high crime,” Republicans have signaled that impeachment can be used as a political weapon.

They have lowered the bar for impeaching government officials — dramatically. They have provided a new rule:

Rule Number Five: We can impeach you if we don’t like you.

It should be obvious that this rule could have terrible consequences for Trump if Democrats win the House in November and Nancy Pelosi returns as Speaker. They are determined to impeach Trump even with no evidence of the non-crime of “collusion.”

So while Avenatti helped the president while trying to remove him, House Republicans have hurt the president while trying to protect him.

At least short-sightedness is bipartisan.

Joel B. Pollak is Senior Editor-at-Large at Breitbart News. He is a winner of the 2018 Robert Novak Journalism Alumni Fellowship. He is also the co-author of How Trump Won: The Inside Story of a Revolution, which is available from Regnery. Follow him on Twitter at @joelpollak.