Judge S. James Otero's said Avenatti's motion depose the president was "premature and must be denied" because it was filed before an anticipated filing by Trump and his personal lawyer in the case.
Avenatti said he would refile the motion in U.S. District Court for the Central District of California to seek Trump's testimony as soon as the president and other parties in the case file an anticipated action seeking to send the dispute to a private arbitrator, instead of a judge.
Daniels sued Trump in California state court on March 6, seeking to void an agreement she signed in October 2016, on the eve of the presidential election.
The agreement required Daniels — who received $130,000 from Trump's lawyer Michael Cohen as part of the deal — to not make public comments about her purported relationship with Trump in 2006 and 2007.
Daniels has said she had sex with Trump once, several months after Melania Trump gave birth to the couple's son in 2006, and saw Trump into the following year.
Spokesmen for Trump have repeatedly said that he did not have sex with Daniels.
Avenatti argues that the agreement is not valid because Trump personally never signed it. The agreement was signed by Daniels and a corporation, Essential Consultants, which was set up by Trump's lawyer Cohen.
Essential Consultants had Daniels' case transferred to federal court in California on March 16.
In winning transfer of the case, EC said that it plans to file a petition forcing the dispute to be settled by arbitration and not by a federal court trial. A court filing by Trump also says he wants the case settled by arbitration, whose proceedings would be held outside of public view, unlike federal court hearings and a trial.
Trump is also seeking at least $20 million in damages from Daniels for multiple violations of the nondisclosure agreement.
In response to those statements, Avenatti asked the judge for an expedited jury trial and permission to depose Trump.
In his ruling, Judge Otero said Avenatti's request is "untimely" because neither EC nor Trump has actually filed petitions asking for the case to be sent to arbitration.
"While EC and Mr. Trump have stated their intention to file a petition to compel arbitration, they have not yet done so," Otero wrote. "If such a petition were filed, a number of the questions raised in Plaintiff's Motion may be answered in the petition, thus limiting the need for discovery on these issues. If such a petition is never filed, Plaintiff's Motion is moot."
"Accordingly, Plaintiff's Motion is premature and must be denied."