(CNN) Porn star Stormy Daniels' attorney, Michael Avenatti, withdrew his motion to participate in the court battle involving the FBI raid of President Donald Trump's attorney's hotel and office Wednesday after a federal judge warned him he would have to "stop your publicity tour."

Avenatti, who practices law in California, had requested to be admitted into the New York proceedings, but was met with fierce objection from the attorney for Michael Cohen, Trump's long-time lawyer, who cited Avenatti's frequent television appearances, public statements about Cohen's guilt and his release of Cohen's personal financial information.

In a nod to that, Judge Kimba Wood told Avenatti that for him to be admitted, "you would have to change your conduct" and "stop your publicity tour." Wood said she didn't mean that in a derogatory way but later said "this conduct is inimitable to giving Mr. Cohen eventually a fair trial."

Wood did not rule on whether to allow Avenatti to appear formally in court but made clear that his time speaking before her was limited. "Until you are admitted I don't expect you to stand here and be heard," the judge told him. About an hour after the hearing ended Avenatti withdrew his motion to appear without prejudice, meaning he could take it up later.

The hearing was set to provide an update of the review of documents seized in the FBI raid but was sidetracked by allegations lobbed by Avenatti about secret audio recordings he alleged Cohen or his associates leaked to the media involving Daniels' previous attorney and by Cohen and Trump's attorneys saying Avenatti's conduct was unfitting.

Read More